-
Notifications
You must be signed in to change notification settings - Fork 201
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
TM Terminal: backspace deletes whole word #392
Comments
Thank you for the bug report. I can reproduce it. Backspace is acting like Ctrl is being pressed. Perhaps we are sending the wrong keycode when backspace is being pressed. Looking around it seems that we are probably sending Ctrl-H when backspace is sent. Looking at microsoft/terminal#755 microsoft/terminal#3935 and microsoft/vscode#98494 certainly makes it look like there is some work to do here. |
A change like this: diff --git a/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java
index 759c16c..03f9d0d 100644
--- a/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java
+++ b/terminal/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java
@@ -1173,6 +1173,13 @@
}
}
+ if (!ctrlKeyPressed && character == '\b') {
+ // \b is ^H which is interpreted by the console as Ctrl + Backspace
+ // which deletes a word. \b on its own should just delete a character
+ // so we send 0x7f to do that.
+ character = 0x7f;
+ }
+
//TODO: At this point, Ctrl+M sends the same as Ctrl+Shift+M .
//This is undesired. Fixing this here might make the special Ctrl+Shift+C
//handling unnecessary further up. works - but I don't know if there should be more conditions on when we make the switch. e.g. should it only apply when running on Windows host? Only when connected to cmd/ps? Something else? |
Just a side note: with the current version of TM Terminal (11.1.0.202212091724), WLS isn't affected by this issue (that is, pressing the backspace key only deletes one character and not the whole word). I've tried both executing |
I tested my change on Windows host with cmd, git bash, wsl and ssh to a linux machine running bash and the behaviour of all of them worked well with the unconditional rewrite of I need to test still Linux host (and maybe mac if I can get a hold of one) as well as connecting to serial connections and gdb CLI (linux only) |
Any update on this? It's a really annoying bug... |
Includes a new system property `org.eclipse.tm.terminal.control.convertBackspace` to allow us to disable this new behaviour in the field if it turns out that some terminal/host combination does not like this conversion. Fixes eclipse-cdt#392
Includes a new system property `org.eclipse.tm.terminal.control.convertBackspace` to allow us to disable this new behaviour in the field if it turns out that some terminal/host combination does not like this conversion. Fixes #392
I have added a fix for this to CDT 11.4.0 due for release in a few weeks. |
I've installed Eclipse 2023-03 (Platform 4.27.0.v20230302-0300) and TM Terminal 11.1.0.202212091724.
In the Terminal view, when I hit the backspace character, the console deletes the whole word on the left instead of a single character.
This happens consistently on two Windows 11 PCs.
I've also tried installing Eclipse (Eclipse IDE for PHP Developers) in a Windows Sandbox: same error.
Here's a sample session:
The text was updated successfully, but these errors were encountered: