termux-app icon indicating copy to clipboard operation
termux-app copied to clipboard

CTRL + space bar should become CTRL-@

Open natebragg opened this issue 11 months ago • 5 comments

According to showkey -a, some keys are not registered or don't have the same output as a desktop terminal (both a bare console and XTerm).

When CTRL+2 is pressed, the output is:

^@        0 0000 0x00

This is the correct behavior.

When CTRL+@ (CTRL+shift+2) is pressed, the output is:

@        64 0100 0x40

This is not correct, it should be the same as CTRL+2 (this is the same behavior as other CTRL+shift+num, which are all incorrect).

CTRL+space is not registered by the terminal (i.e.,nothing is printed). This is also not correct, it should have the same output as CTRL+2.

I use these keys frequently, so pretty please support it.

natebragg avatar Mar 25 '24 15:03 natebragg

For me: Ctrl+Space sends ^@ Ctrl+@ and Ctrl+Shift+2 sends @ Ctrl+2 sends nothing

ErrrorMaxx avatar Mar 25 '24 15:03 ErrrorMaxx

If it makes a difference, I'm typing this on a physical keyboard. Is there a way to collect logs for this that I can post here?

natebragg avatar Mar 25 '24 20:03 natebragg

Pretty sure this will depend on the layout of your physical keyboard, and the selected language/layout of the keyboard in android settings. What type of keyboard are you using?

Is there a way to collect logs for this that I can post here?

You can get more information about keys and how termux interprets them through long press -> settings -> Termux -> Debugging -> Terminal View Key Logging. Then run logcat in a separate terminal (preferably in an SSH shell from another machine to decrease noise)

Grimler91 avatar Mar 25 '24 21:03 Grimler91

After much messing around, I have learned two things. I compared the device with this issue (Meta Quest 3) with my phone (Pixel 8). CTRL+space works on the pixel, but fails on the Quest. On the Quest for some reason numlock is set (my keyboard has no numpad or numlock key). The output of CTRL+2 vs CTRL+@ is opposite between the two (CTRL+2 => ^@ on the Quest, but 2 on the Pixel). The big difference though is that the Quest requires setting ctrl-space-workaround in termux.properties.

In light of that, I'd ask two things with this ticket:

  1. if there are system-wide device specific settings for ctrl-space-workaround, please add the Quest to that list.
  2. CTRL+2 and CTRL+@ should behave the same, and both produce ^@

natebragg avatar Mar 27 '24 16:03 natebragg

Is this able to be resolved?

natebragg avatar Jul 30 '24 13:07 natebragg