-
Notifications
You must be signed in to change notification settings - Fork 77
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
Alt+Enter to forced insert newline doesn't work on macOS #80
Comments
As keyboards of Mac don't have Alt key, option+Enter seems inserting a newline. |
Additional contextI'm using iTerm2 and have option set to send ESC+key. For option+return, it sends versions $ ruby -r reline -r readline -e 'p ruby: RUBY_VERSION, readline: Readline::VERSION, reline: Reline::VERSION'
{:ruby=>"2.7.0", :readline=>"8.0", :reline=>"0.1.2"} inputrc https://github.com/JoshCheek/dotfiles/blob/149bcb6d74c1aeaef0d5502e2982fc050b8ff9d7/inputrc Readline $ ruby -e 'print "abc def\e\r"' | ruby -r readline -e 'p Readline.readline "> "'
> abc def
"abc def" Reline (via pipe) $ ruby -e 'print "abc def \e\r"' | ruby -r reline -e 'p Reline.readline "> "'
▽Traceback (most recent call last):
6: from -e:1:in `<main>'
5: from /Users/josh/.rubies/ruby-2.7.0/lib/ruby/2.7.0/forwardable.rb:235:in `readline'
4: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline.rb:183:in `readline'
3: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline.rb:203:in `inner_readline'
2: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline.rb:336:in `may_req_ambiguous_char_width'
1: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline/ansi.rb:69:in `cursor_pos'
/Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline/ansi.rb:69:in `raw': Inappropriate ioctl for device (Errno::ENOTTY)
7: from -e:1:in `<main>'
6: from /Users/josh/.rubies/ruby-2.7.0/lib/ruby/2.7.0/forwardable.rb:235:in `readline'
5: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline.rb:183:in `readline'
4: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline.rb:203:in `inner_readline'
3: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline.rb:336:in `may_req_ambiguous_char_width'
2: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline/ansi.rb:66:in `cursor_pos'
1: from /Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline/ansi.rb:83:in `rescue in cursor_pos'
/Users/josh/.gem/ruby/2.7.0/gems/reline-0.1.2/lib/reline/ansi.rb:83:in `pread': not opened for reading (IOError) Reline (via TTY) Okay, in the above, we can see it's trying to do tty operations on the pipe, which goes into some failure block where it fails while trying to read from stdout. If we try typing those keys instead of piping them into it, nothing happens. This matches Readline's behaviour, but my understanding was the purpose of the lib was to allow multiline editing, so I would expect it to treat this as a non-submitting newline. |
This is a terminal emulator setting thing. |
No description provided.
The text was updated successfully, but these errors were encountered: