Skip to content
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

Can't delete over previous search string #1353

Open
cqexbesd opened this issue Dec 1, 2023 · 3 comments
Open

Can't delete over previous search string #1353

cqexbesd opened this issue Dec 1, 2023 · 3 comments
Labels
bug Something isn't working high priority High Priority Item VT: Backend Virtual Terminal Backend (libterminal API)

Comments

@cqexbesd
Copy link
Contributor

cqexbesd commented Dec 1, 2023

Contour Terminal version

0.4.0-master-9c3073db

Installer source

Github: source code cloned

Operating System

Arch Linux as of a few days ago

Architecture

x86-64

Other Software

No response

Steps to reproduce

  1. Go into vi mode (^shift-space)
  2. Search for something (/something)
  3. Hit return
  4. Enter search mode (/)
  5. Try using backspace to delete the previous search string
  6. Note that ^U still works

Expected Behavior

Backspace would delete single characters

Actual Behavior

Nothing happens when pressing backspace (Debug[default]: sendKeyEvent: 16777219 "\b" QFlags<Qt::KeyboardModifier>(NoModifier) ((null):0, (null))).

^BS seems to move the cursor forward (Debug[default]: sendKeyEvent: 16777219 "\b" QFlags<Qt::KeyboardModifier>(ControlModifier) ((null):0, (null))) though if you later type a regular character the cursor jumps back to where it was.

^H seems to be ignored ([error] ViInputHandler: Receiving control code Control+0x48 in search mode. Ignoring.).

Additional notes

No response

@cqexbesd cqexbesd added the bug Something isn't working label Dec 1, 2023
@christianparpart
Copy link
Member

^H is ignored, becuase the search input field is manually implemented. If you press ^H (Control + H), then it's interpreted as such - a keyboard shortcut.

Can you please run Contour with the following CLI args: contour debug gui.input,vt.input and then press Backspace on your keyboard?

This is how it looks like for me:

[2023-12-01 20:06:28.372398583.372397] [gui.input] Key Press event received:  Backspace
[2023-12-01 20:06:28.372576624.372576] [vt.input] Sending  "Backspace" Press.
[2023-12-01 20:06:28.575200045.575199] [gui.input] Key Release event received:  Backspace

Surprisingly (?) for me, pressing Backspace key in the search field, in order to delete the character left to the cursor, is actually working.

The reason why Ctrl+U is working for you, is, because I manually implemented that (because I use that a lot myself:D).

I would like to understand why you probably won't get "Backspace" events (as I posted in the logs above) rather than working around it without understanding why our two systems differ.

Can it be that you're building against Qt5 while I am using Qt6?

@cqexbesd
Copy link
Contributor Author

cqexbesd commented Dec 1, 2023

Debug[default]: sendKeyEvent:  16777219   "\b"   QFlags<Qt::KeyboardModifier>(NoModifier) ((null):0, (null))
[2023-12-01 21:59:43.273265039.273264] [gui.input] Key Press event received:  Backspace
[2023-12-01 21:59:43.273314683.273314] [vt.input] Sending raw input to stdin: \x08
Debug[default]: sendKeyEvent:  16777219   "\b"   QFlags<Qt::KeyboardModifier>(NoModifier) ((null):0, (null))
[2023-12-01 21:59:43.386451039.386450] [gui.input] Key Release event received:  Backspace

So my BS key sends the ASCII BS - but yours sends "Backspace" - is this an extended keyboard mode thing?
^BS sends 7f (ASCII DEL) but if you have to handle each character I guess it sort of makes sense that moves the cursor on the screen but not internally.

(update: according to od when Contour says its sending Backspace things are receiving DEL(7f) and if I press Delete it sends some escape sequence. stty says erase is ^H (ASCII BS) so maybe the search field should respect the termios settings? Sending BS or DEL is complicated I know)

As an experiment I bound Backspace to Backspace in my config and the log now looks like:

Debug[default]: sendKeyEvent:  16777219   "\b"   QFlags<Qt::KeyboardModifier>(NoModifier) ((null):0, (null))
[2023-12-01 22:07:35.708984434.708984] [gui.input] Key Press event received:  Backspace
[2023-12-01 22:07:35.709484950.709484] [vt.input] Sending  "Backspace" Press.
Failed to open VDPAU backend libvdpau_radeonsi.so: cannot open shared object file: No such file or directory
Debug[default]: sendKeyEvent:  16777219   "\b"   QFlags<Qt::KeyboardModifier>(NoModifier) ((null):0, (null))
[2023-12-01 22:07:35.797433080.797432] [gui.input] Key Release event received:  Backspace

Backspacing in search now works, though the shared library error was unexpected.

ldd says I'm using QT6.

@christianparpart
Copy link
Member

Ok, let me simply also act on \x08 then. I'll keep you posted. Thx :)

@christianparpart christianparpart added this to the 0.4.0 milestone Dec 1, 2023
@christianparpart christianparpart added the VT: Backend Virtual Terminal Backend (libterminal API) label Dec 1, 2023
@christianparpart christianparpart modified the milestones: 0.4.0, 0.4.1 Dec 19, 2023
@christianparpart christianparpart modified the milestones: 0.4.1, 0.4.2 Jan 1, 2024
@christianparpart christianparpart added the high priority High Priority Item label Feb 2, 2024
@christianparpart christianparpart removed this from the 0.4.2 milestone Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority High Priority Item VT: Backend Virtual Terminal Backend (libterminal API)
Projects
None yet
Development

No branches or pull requests

2 participants