Skip to content
This repository has been archived by the owner on Sep 21, 2019. It is now read-only.

Fix broken parsing #2

Merged
merged 1 commit into from
Jan 30, 2013
Merged

Fix broken parsing #2

merged 1 commit into from
Jan 30, 2013

Conversation

myw
Copy link
Contributor

@myw myw commented Jan 30, 2013

Using \n as a separator for the pane id of the created window
does not work for me, not sure why. Replaced it with :, and 
parse it with a tr in the next line.

Using `\n` as a separator for the pane id of the created window
does not work for me, not sure why. Replaced it with `:`, and 
parse it with a `tr` in the next line.
pi8027 added a commit that referenced this pull request Jan 30, 2013
@pi8027
Copy link
Owner

pi8027 commented Jan 30, 2013

Please try this code. 6020456

pi8027 added a commit that referenced this pull request Jan 30, 2013
@myw
Copy link
Contributor Author

myw commented Jan 30, 2013

This did not work, as I suspected it would not. The issue is not with quoting $result, but rather with the \n in the -F format given to the tmux new-window command. I'm not exactly sure why it works on some machines and not others, but interpolation after that many levels of quoting is always complicated. Note that switching the sh-bang in line 1 from /bin/sh to /bin/bash, which might explain some difference in behavior across systems, did not work.

I know the fix provided is not as terse as you had it, but it works, and it uses the same technique you do earlier. Why not just accept the pull?

@pi8027
Copy link
Owner

pi8027 commented Jan 30, 2013

Why not just accept the pull?

In your code, if -PF is given and format contains :, all of : will be replaced by \n. But sed '1 s/:/\n/' can solve it.

pi8027 added a commit that referenced this pull request Jan 30, 2013
@pi8027 pi8027 merged commit b5f96ce into pi8027:master Jan 30, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants