Commit Graph

4 Commits

Author SHA1 Message Date
ridiculousfish
533ee65963 Allow binding nul (zero byte)
This sequence can be generatd by control-spacebar. Allow it to be bound
properly.

To do this we must be sure that we never round-trip the key sequence
through a C string.
2019-09-14 16:37:57 -07:00
Kurtis Rader
9f8d854c2a fix race condition in fkr test 2016-12-19 17:44:54 -08:00
Kurtis Rader
68e167d576 f-k-r should use the user's locale
I did some research and experiments. For good or bad the `bind` command
requires the use of wide char codepoints (e.g., \u1234) for non-ASCII
chars.  So don't force the use of the POSIX locale, but do provide it as
an option for people who want to see the individual bytes rather than a
decoded wide char.

Simplify the format of the information displayed for each character. There
really isn't much point in providing decimal, octal, and hexadecimal. Just
print hex and symbolic representations.

Add an example `bind` command that a user can copy/paste.

Closes #3183
2016-06-30 20:49:56 -07:00
Kurtis Rader
d7bc20c933 don't allow f-k-r to run if stdin/stdout not a tty
Another developer noticed that redirecting stdin of `fish_key_reader`
results in weird behavior.  Which is not at all surprising. So add checks
to ensure stdin and stdout are attached to a tty.

Add some rudimentary unit tests for this program.
2016-06-26 21:51:00 -07:00