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

Ctrl-U shortcut pushes the cursor forward #74

Closed
jagtesh opened this issue Feb 10, 2014 · 7 comments
Closed

Ctrl-U shortcut pushes the cursor forward #74

jagtesh opened this issue Feb 10, 2014 · 7 comments

Comments

@jagtesh
Copy link

jagtesh commented Feb 10, 2014

On OS X, pressing Ctrl-U after typing a word with a space pushes the cursor several whitespaces beyond the prompt. It's as if some imaginary text exists between the cursor and the prompt. It's not possible to bring the cursor back, even by pressing the backspace key unless return is pressed.

screen shot 2014-02-10 at 11 37 46 am

@georgebrock
Copy link
Collaborator

This looks like it might be a libedit bug.

There are two different line editors that the Ruby standard library can use: GNU readline and libedit. For licensing reasons, system Ruby on OS X (and other BSD-based OSes) uses libedit, but GNU readline is used by Bash and has more features and (in my experience) fewer bugs.

If you install Ruby using Homebrew (brew install ruby) you'll get a version of Ruby 2 that uses readline instead of libedit. Re-installing gitsh (brew uninstall gitsh && brew install gitsh) should link against that Ruby version.

There are some pure Ruby implementations of readline, which we could distribute with gitsh, but so far we've tried has been worse than libedit and much worse than GNU readline.

@hakanw
Copy link

hakanw commented Feb 11, 2014

I also see the text input gets messed up if you press up/down-arrow to walk through the shell history.

@georgebrock
Copy link
Collaborator

@hakanw That's definitely related to libedit issues, and goes away when Ruby uses readline.

@hakanw
Copy link

hakanw commented Feb 11, 2014

But won't it be a long time until all (for example) OS X installations update its system ruby and system libedit? Maybe if gitsh wants to work on homebrew and for normal setups it should consider a fix or workaround for this?

@georgebrock
Copy link
Collaborator

I'm actively looking for alternatives (see #49) but in the meantime it is possible to work around the problem by installing Ruby using Homebrew, instead of using system Ruby.

@ericmerrill
Copy link

I want to point out for people - this but all effects Ctrl-A (jump to beginning of line).

Also, George's fix of installing brew ruby, then reinstalling gitsh does indeed fix it.

@georgebrock
Copy link
Collaborator

Since I'm looking for alternatives (#49) and we have a nice work around (Homebrew Ruby) I'm going to close this for now.

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

No branches or pull requests

4 participants