Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

powerline splits commands #372

Closed
janrito opened this issue Mar 30, 2013 · 8 comments
Closed

powerline splits commands #372

janrito opened this issue Mar 30, 2013 · 8 comments

Comments

@janrito
Copy link

janrito commented Mar 30, 2013

Powerline intermittently splits a command from its arguments, passing them as if they were two separate commands:

$ fossil diff -y white\ dist.py
Usage: fossil COMMAND ...
   or: fossil help           -- for a list of common commands
   or: fossil help COMMMAND  -- for help with the named command
   or: fossil commands       -- for a list of all commands
diff: missing operand after `white dist.py'
diff: Try `diff --help' for more information.
$ 

This is passing fossil to bash, and then diff -y white\ dist.py as a separate command. Both fail because they are incomplete.

Apart from being a bug. I could envision a few instances where this would be dangerous.

@ZyX-I
Copy link
Contributor

ZyX-I commented Mar 30, 2013

Powerline does not do anything with your input. Can you provide steps to reproduce starting from zsh -f/bash --norc --noprofile?

@jarnett
Copy link
Contributor

jarnett commented Sep 17, 2013

This happens to me as well using bash with powerline inside of tmux. It only seems to happen after being idle for a long period of time.

for example.

$ ssh user@hostname
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-I pkcs11] [-i identity_file]
[-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]
-bash: user@hostname: command not found

try the same command again immediately afterward and it works.

@janrito
Copy link
Author

janrito commented Sep 18, 2013

Hi @jarnett,

I originally thought this was a issue caused by powerline, but I am not sure anymore. It is a really annoying bug, and I haven't figured out how to solve it.

You are right, it only happens when the session is idle for a while. I face it both in os x and ubuntu, locally and over ssh.

@jarnett
Copy link
Contributor

jarnett commented Sep 30, 2013

I just happened upon a way to recreate this issue at will.

When running tmux with powerline enabled, if you resize your ssh session window the very next command typed will fail in the way previously mentioned.

I tried this with powerline disabled in both tmux and bash and everything worked as expected.

with some debugging enabled in bash I see that '_powerline_tmux_set_columns' is executed after a resize, but i'm unsure how this is related.

@brad-haynes
Copy link

Similarly, I can recreate this problem with a split command.

Steps to recreate:

  1. Split vertically with C-b %
  2. Return to previous pane with C-b
  3. ls --color=auto

Splits command into "ls" and "--color=auto" returning "--color=auto: command not found"

Command is executed successfully on second attempt.

@jarnett
Copy link
Contributor

jarnett commented Oct 5, 2013

found this link referencing a similar issue:

http://comments.gmane.org/gmane.comp.shells.bash.bugs/20136

and made a change to powerline.sh that fixes the problem for me.

tmux setenv -g TMUX_"$1"_`tmux display -p "#D" | tr -d %` "$2"

instead of:

tmux setenv -g TMUX_"$1"_$(tmux display -p "#D" | tr -d %) "$2"

@brad-haynes
Copy link

This works for me as well.

Thanks.

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 17, 2014

Powerline has a workaround now, but it is still a bash bug. Hence INVALID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants