-
Notifications
You must be signed in to change notification settings - Fork 23
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
[BUG] option+enter doesn't add newline in REPL like it does in Julia at commandline #340
Comments
Based on some experimentation at the terminal, it looks like option+enter is maybe sending I used vim to edit my terminal command to insert the option+enter key via ctrlV + optionenter, to get this: $ julia -i -e 'x="^[
"'
...
julia> x
"\e\n"
julia> x[1]
'\e': ASCII/Unicode U+001b (category Cc: Other, control) |
Aha! And after reading about And yes, in fact, at the Juno REPL, you can achieve the same thing by pressing escape+enter! :) Good to know. |
Per @pfitzseb: This is an upstream issue that comes from our terminal emulator: xterm.js. Possibly relevant issues there:
Also maybe relevant, is this There's an option for that in the julia-client, but i don't think it's related to this behavior. |
X-Ref xtermjs/xterm.js#2364. |
Just a heads up, on the latest release this seems to be fixed: option+enter does insert a newline, and doesn't enter the line on the REPL. But, on my machine, option+enter is now adding two newlines, not just one. 😅 I don't really mind, that's just formatting, but just wanted to let you know. EDIT: Indeed, it looks like optionenter is sending |
Does the |
The double new-line bug should be fixed in the latest release (or on master). Turns out I was listening to both key-down and key-up events... Not sure how I didn't notice that locally. |
Haha cool, thanks! :) looking forward to it! 🚀 |
Just wanted to note that xtermjs/xterm.js#2718 was finally merged, so it's possible that you can remove whatever mac-specific hacks you had to do here? (Also, 😬 i don't think we ever got this to be working quite right... As things stand right now, on my mac, option+enter now enters two newlines and still submits the line in the repl 😢. So maybe integrating the changes from xterm will help?) |
Oh, for real? It's been working great for me on Linux ;) But yeah, we'll upgrade to xterm.js 4.6 once it's out. |
haha yeah i know, sorry. I think it was working for a little while? And then regressed, and i never updated the issue.. Sorry! 😅 But yeah, cool, sounds good! |
Please search existing issues to avoid duplicates.
Details
v1
Steps to reproduce
This can be quite annoying if you're editing a long function definition or
begin ... end
block, and try to add a newline in the middle. It's easy to build-up that muscle memory from working with julia in the terminal, and it's surprising when that doesn't work in Juno.The text was updated successfully, but these errors were encountered: