-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
REPL: change ^U to delete left part of the line #24948
Conversation
+1 to keeping our bindings as standard as possible. |
ac34f62
to
6356f27
Compare
I figured out (it was not difficult!) that ^C can clear the input area if it's not empty, and otherwise try to call the debugger (someone using it?). For non-julia modes, does the same (clear the area) and transiton back to julia-mode if the input area is empty. Seems sane to me, good to go? PS: I also removed the printing of "^C\n\n" which I find non-useful... I will re-add back if requested. |
I rather have the |
OK no problem. By curiosity, is it to have visual feedback that Julia understood the message (but couldn't do much about it)? or by consistency with some other shells? Would having the prompt "beeping" be a fine replacement to printing "^C\n" for you? |
For motivating having a binding for clearing the input area: in shells with readline, you can delete the input line with the combo ^k^u, which is good enough, but with multiline input like in Julia this doesn't work anymore. |
@KristofferC would you be fine with the REPL "beeping" (the small blink like when pressing backspace when it's not possible) instead of printint ^C ? |
I like having it printed (like in the terminal). |
6356f27
to
2f3abe9
Compare
How do I disable this? |
Can we revert the change to There is also the following weird behavior:
|
This is no different than what we had before, except you would use ^-U to clear the lines instead of ^C. I'm not saying it's nice though (we could skip empty lines for example).
What would you propose instead as default key for clearing the input area?
You could add to your keymap the previous code, although it would be nicer to have it put into an easier function to call. But it's a bit trickier to change the ^C binding which controls getting back to the main julia mode (in REPL.jl); I guess it could be possible to change that from .juliarc.jl by overwriting the
Are you bothered by having to press ^C twice or to not be able to not delete the started line (your previous point) ? As for reverting, I'm reluctant as it's not clear that you preference is objectively more ergonomic, so I see what IPython does as a sane choice (even if it was apparently not true concerning
For ^C, see above, for ^U you can put |
Pressing ^C gave me a fresh prompt, I could see the previous one and I could see that I pressed ^C to abort it. Which is how the shell does (except it doesn't show the ^C). So ^C already worked fine for me for this except the advantages previously listed are now removed.
Yeah, forcing people to press twice to do something they previously needed to press once tend to make them annoyed. I don't think copying functionality from IPython just because it is IPython is a good idea. |
Genuinely sorry to contribute to make you annoyed. In this case, it was for getting a more standard binding for ^U, ie. delete from begining of line till the point. I explained why it's useful to have a specific binding to clear the input area, unlike in the shell where ^u^k is a decently short combo. I think it's more necessary to have a binding for clearing the input area, than for cancelling the current input and having it kept in the history (if you don't need to keep it in history/keep seing it above the current line, the current ^C does the job). Obviously you disagree, but we lack more data to choose the default. Then, I think, unlike you again, that following IPython with its many years of maturity is a decent choice. |
Any change in a UI will leave someone annoyed so no need to apologize :)
Well, I would counter that the Julia REPL also has quite a few years of maturity and is in addition a much better REPL than IPython. Also, a large number (thousands) of users muscle memory is also to take into account. Sure, sometimes one has to change UI but then it should be significantly better because it breaks patterns that has been grained into the brain over years of usage and that will be a source of annoyance / awkwardness until you relearn, which might take quite a while. |
In all REPLs I know, ^U is bound to deleting the lines from point leftwards to the begining of line, so I propose to do just this in the Julia one. To clear the input area (which was bound to ^U), I would think of ^C, which is what IPython does, but it's bound to the "julia debugger" currently, which does seem to be enabled only on windows... does anyone use it, and can we reclaim this binding for clearing the input area?