Last active
April 3, 2024 08:55
-
-
Save tompng/bb6d351cce4a71f551e94137ad0136da to your computer and use it in GitHub Desktop.
cchars memo for reline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAYBE_TIOCGETC = [ | |
0x40067412, # M2 Mac | |
2, # docker rubyfarm? something is wrong | |
# unknown, found in github search | |
('T'.ord << 8) | 2, | |
('t'.ord << 8) | 18 | |
] | |
cchars = "\0" * 256 | |
STDIN.ioctl(TIOCGETC, cchars) | |
p cchars.chars.take(5) # => ["\C-c", "\C-\\", "\C-q", "\C-s", "\C-d"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment