Control characters like Ctrl+A/Ctrl+E/Ctrl+K not working #148
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First off, this terminal is simply awesome eye candy. Good work!
I noticed one strange behaviour, though - in other terminals I can use control character sequences like Ctrl+A (move to the beginning of the line), Ctrl+E (move to the end of the line) or Ctrl+K (remove the rest of the line starting from the cursor position). There are likely more - in CRT they all result in the characters being printed literally, e.g. pressing "Ctrl+A" prints "^A" instead of moving the cursor. Sure, for cursor navigation I could use "Home" and "End" (which work), but my fingers are hard-coded to these sequences and they do work as expected in other terminal windows :)
Thanks!
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5132500-control-characters-like-ctrl-a-ctrl-e-ctrl-k-not-working?utm_campaign=plugin&utm_content=tracker%2F479407&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F479407&utm_medium=issues&utm_source=github)."Alt+." is another candidate.
Hi @LenzGr, I'm glad you are enjoying it. Sadly I'm not an expert on the subject @yurikhan kindly made the xterm keytab, and I'd like his thoughts on this request (to see if we should include them as default or not).
In the future we might add a way to add custom keybindings, but at the moment the only solution is to add them to konsole-qml-plugin/assets/kb-layours/xterm.keytab if you want to play with that.
@LenzGr Please write a full-form bug report. Specifically, I think at least the following information is needed for us to help you solve your problem:
TERM
environment variable when you experience the problem?screen
and/ortmux
)?$TERM
inside them?For me, under Ubuntu 14.04, c-r-t rev.
9bd0ca7
, inbash
, withTERM
set toxterm-256color
, when I type a command line and pressCtrl+A
, the cursor moves to the start of the line; when I then pressCtrl+E
, it moves to the end of the line; when I move the cursor a few characters to the left by pressing the Left arrow and then pressCtrl+K
, the characters under the cursor and to the right of it disappear; andAlt+.
inserts at the current position the last argument of the previously executed command.Similarly, on the same OS and c-r-t, with
tmux
running in c-r-t,TERM
set toscreen-256color
, the same steps cause the same reactions.If I press
Ctrl+V
Ctrl+A
, a^A
sequence appears in the command line, and when I press the Left arrow, the cursor moves left two positions, indicating that it’s a literalSOH
control character. (UsingCtrl+V
to treat the next key literally is a feature ofbash
and possibly other shells.)If I start
dash
in my c-r-t and pressCtrl+A
, a^A
sequence appears. If I pressHome
, a^[[H
sequence appears. For me, this happens both in c-r-t and other terminals (xterm
andxterm
+tmux
).@Swordfish90 This all boils down to a simple question: Which terminal do you want to emulate?
In terms of compatibility with applications, it seems best to emulate (a subset of) xterm, because then you don’t have to concern yourself with writing a terminfo file, getting it upstreamed in ncurses, etc.
And an xterm-compatible terminal emulator has to emit by default the same key codes as xterm does, otherwise users will be surprised.
Thank you @yurikhan . I think we should stick with xterm, I thought there were issues with the keycodes but I just tested them carefully and everything works fine for me (Ubuntu 14.04 bash xterm), so let's see the full bug report, but it seems to be a specific problem.
@yurikhan thanks for the detailed response. I apologize, I should have provided more details to begin with. Here we go:
800bbd3
)I start CRT by calling the resulting binary:
./cool-retro-term
$TERM
is set toxterm
,$SHELL
is/bin/zsh
Pressing common key combinations like
Ctrl+A
,Ctrl+E
do not behave as expected (and how they work in other terminals likeguake
orgnome-terminal
). For example, I expectCtrl+A
to jump to the beginning of the line (similar to what pressingHome
does). Instead, the control character^A
is printed to the screen. Interestingly, a gnome-terminal started from c-r-t exposes the same behavior.This is a plain local shell, no SSH or screen involved.
I compared the differences in the environments of c-r-t and gnome-terminal, here is the diff:
The only possible offending difference seems to be the
KB_LAYOUT_DIR
environment. However, unsetting it does not have any noticeable effect.KB_LAYOUT_DIR is surely not the reason. It simply indicates where the keytabs files are stored, and is only read by the plugin when it starts.