-
Notifications
You must be signed in to change notification settings - Fork 85
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
Remove terminfo.rb #769
Remove terminfo.rb #769
Conversation
…nment. Reline works perfectly in most major terminal emulators without terminfo. In minor/old terminal emulator, we used to get key bindings from terminfo, but I think it is not used so much.
If we should extract this feature to like |
Having an optional dependency for a small group of users to adapt reline to their keybindings seems like a great solution. |
I think supporting terminfo inside Reline is more maintainable compared to supporting reline-terminfo gem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in support for this. Thank you for spending time investigating the usage of it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I tried a quick check with TERM settings in iTerm2, and there were no issues.
non-windows environment. (ruby/reline#769) Reline works perfectly in most major terminal emulators without terminfo. In minor/old terminal emulator, we used to get key bindings from terminfo, but I think it is not used so much. ruby/reline@3ceba3bff7
Reline uses fiddle to load terminfo from libncurses.
Fiddle and libncurses are not available in some environment. Fiddle will be removed from default gems, so we will going to have more problem loading terminfo.
When Reline is used in most terminal emulator, terminfo has no effect. Reducing dependency is better.
Impact of removing terminfo.rb
It depends on the statistics of environment variable TERM used in real world.
I searched with "export TERM=" in github.
(This does not reflect actual terminal emulator used in real world, but I don't have idea to figure it out)
Out of 46.8k files, these TERM values (146 files) has a different key bindings from key bindings that Reline registers without terminfo.
Detailed result is here https://gist.github.com/tompng/2e19e75234f61e250bafd4c50ec5b7be
Checking with
infocmp
command,sun
,vt52
andd210-dg
does not havecuu
cud
hpa
capability that Reline uses. Reline might not work even with terminfo, so exclude them.cons25
have differenthpa
value,mach
andxtermc
does not havehpa
. Perhaps Reline does not work in these environments too.In
TERM=aaa-60|aixterm|cons25|mach|qansi|xtermc
, End, PageUP, PageDown, Delete(Not Backspace) won't work. But some keyboard (example: Macbook) does not have these keys in the first place.- - - \e[P
\e[146q \e[150q \e[154q \e[P
\e[F \e[I \e[G \u007F
\e[Y \e[V \e[U \e[9
\e[Y \e[V \e[U \e[P
\e[Y \e[V \e[U -
Other tools
Readline uses terminfo
zsh
uses terminfo.node
andipython
does not seem to use terminfo