-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
ESC is sometimes dropped #1017
Comments
Good morning. I wonder if that is really a thing or if CSIu us the only way to fix this. 🤔 |
I don't know if this helps but I just hit it in the shell with
Based on timing of log messages, is the ESC interpreted as "clearing selection" and not a regular key press? I'm not sure what the selection was - I wasn't aware of having anything selected at either time but maybe I mis-clicked at some point and had selected something? I will watch out for that in future to see if this is what is happening - I don't know if there is a debug flag to record such events? |
Just hit it again and there was certainly nothing selected that was visible, but there would have been something selected in the shell before I entered vi. If this is the cause then I shouldn't hit it again (assuming no more selection) whilst I am in vi - and that seems to be the case. So that probably means this isn't a bug but a design flaw - in so far as the code is probably doing what was planned but the user experience seems sub par. It seems like selecting with the mouse effectively puts the terminal into a special mode that you need to use ESC to get out of, but everything else works as normal. I think there should be no special mode and there can be a key combo to deselect if you want - which you could map to ESC if you really wanted to but is probably better using ctrl-shift-something like the other defaults. |
I have now removed the mapping for ESC to clear selection (which is the default) and I see no more lost ESCs so I think this was the problem. So I would say ESC shouldn't be mapped by default to anything, given it is captured even if the selected item has scrolled off long ago, |
loool. Thanks @cqexbesd for the patience and finding out yourself. You would have made me going crazy trying to reproduce this (while not using the mouse) :-D So I guess we can close it then? And, this default key mapping of ESC clearing the selection in case something was selected, to me personally, still makes sense to keep as default. Hm, wait, maybe I can generally improve on the |
I don't know the best solution but I think something should change - because it took me so long to work out what was going on and it was very annoying. Obviously it will only affect mouse users but I remember computers before mice and I think mice are great :-P Probably the key confusing thing is that if the selected text is no longer on the screen, perhaps hidden by an editor, or just scrolled off, then there is no sign as to what ESC has done. If your workflow involves frequent copies though there will often be something selected and in previous terminal emulators it made no difference - mostly because the terminal was (probably) unaware of anything selected by mouse - the mouse did mouse things and the keyboard did text things. Contour merges these two worlds. |
Fixes mouse selection to only be initiated if actually meant to, i.e. in alt screen mode only if bypass-modifier was pressed (#1017). Signed-off-by: Christian Parpart <christian@parpart.family>
Fixes mouse selection to only be initiated if actually meant to, i.e. in alt screen mode only if bypass-modifier was pressed (#1017). Signed-off-by: Christian Parpart <christian@parpart.family>
Contour Terminal version
0.3.10-master-2532adfe
Installer source
Github: source code cloned
Operating System
Arch Linux as of approx a week ago
Architecture
x86-64
Other Software
NVIM v0.8.2
Steps to reproduce
In a vi session, occasionally, a press of ESC is missed. It only happens occasionally and I don't know how to reliably trigger it. It may not be related to being in vi but of course that's when I would notice missing ESC.
With some debug tags on I see:
So it looks like the ESC is missed being sent to the pty and from then on the input and output log messages are in reverse - i.e it sends my input before it receives it.
Expected Behavior
Every press to be sent
Actual Behavior
ESC was swallowed
Additional notes
No response
The text was updated successfully, but these errors were encountered: