1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Disable any implementation-defined special control characters

Including dsusp, lnext, and so on.

https://github.com/ruby/reline/commit/a44abe586b
This commit is contained in:
Nobuyoshi Nakada 2019-12-14 11:05:16 +09:00 committed by aycabta
parent fbe229906b
commit 11db4d3a3b

View file

@ -121,15 +121,11 @@ class Reline::ANSI
retrieve_keybuffer
int_handle = Signal.trap('INT', 'IGNORE')
otio = `stty -g`.chomp
setting = ' -echo -icrnl cbreak'
setting = ' -echo -icrnl cbreak -ixoff -iexten'
stty = `stty -a`
if /-parenb\b/ =~ stty
setting << ' pass8'
end
if /\bdsusp *=/ =~ stty
setting << ' dsusp undef'
end
setting << ' -ixoff'
`stty #{setting}`
Signal.trap('INT', int_handle)
otio