clink icon indicating copy to clipboard operation
clink copied to clipboard

Ctrl + Backspace doesn't work

Open MrDemocracy opened this issue 5 years ago • 7 comments

Normally when I hold CTRL and use the backspace key, it deletes everything until the next space, but with clink this doesn't happen. The CTRL+/ function does however works almost the same way as the stock cmd, but Clink also jumps to the next special character or any type of opening bracket. I wish there was an option to disable/enable this, so that it only jumps to the next space.

MrDemocracy avatar Nov 04 '18 00:11 MrDemocracy

I'm not sure why it isnt working for you coz, it is working for me. Can you describe with an example?

Clink also jumps to the next special character or any type of opening bracket

I tried this. However, it happened me for a closed bracket. maybe an example for this as well?

aniketgm avatar Nov 09 '18 07:11 aniketgm

CTRL+ only deletes one character. It doesn't matter what text is put in the cmd prompt.

Example with any type of brackets: somerandomtext{somerandomtextinsquirlybrackets} . When I hit CTRL+ when the cursor is at the far right before the period, the cursor is moved here: somerandomtext{(here)somerandomtextinsquirlybrackets} . It's the same with () and []. Why is clink even jumping to special characters? It's way better to jump to previous whitespaces, at least when using CTRL+.

MrDemocracy avatar Nov 09 '18 16:11 MrDemocracy

You are right. my bad, I had some extra things installed with clink. I'm looking into it. thanks

aniketgm avatar Nov 15 '18 05:11 aniketgm

Having the same issue with CTRL + backspace. Clink offers ALT + backspace instead which is not really what I am used to. 😢

gohar94 avatar Dec 05 '18 00:12 gohar94

I disagree with Mr. Democracy. The appropriate option is to stop at the special character. In fact I would be surprised if base command prompt didn't do that. It's because in nearly every case I can think of, it denotes a new "token" of some sort. Like hamburger(8). The appropriate behavior is to stop before the paren so that you can change the numerical term, and then hitting it again, change the word term. This is extremely common. So much so, that I don't think it is CLINK you are complaining of. I think its windows. If you are using braces like this hamb}urg{er8( - then I hate to tell you, but you are doing it wrong. It should stop at each such delim. Think about code public static void main(String[] args) { The expected behaviour is most definitely to stop at the S in String and then the m in main.
No room for debate.

Ctrl+Backspace at least you are describing the standard behavior, and I agree it should be there. I already don't use it though- I hold shift and ctrl and arrow for everything, then once selected hit backspace. This however is NOT working, and it should be.

altimmons avatar Feb 16 '19 07:02 altimmons

I'm having the same problem. del: Deletes single character in front of cursor backspace: Deletes whole word behind cursor ctrl+backspace: Deletes single character behind cursor

Using a fresh version of clink on Windows 10 2004 I'm experiencing ctrl+backspace removing a single character and backspace removing a whole word.

I think this code is the culprit https://github.com/mridgers/clink/blob/823d841bc5c38a83c3cc0991c1f3ff8099d83fb5/clink/terminal/src/win_terminal_in.cpp#L258-L269

From reading that it sounds like the ctrl character is virtually always pressed and unset for specific keys. This makes sense why the del (0x2E) key works fine but backspace (0x08) doesn't since this if statement only evaluates true for characters greater than 0x1f.

I would like to press backspace without the ctrl key and it only delete a single character.

Ragnoroct avatar Aug 12 '20 18:08 Ragnoroct

This is fixed in the chrisant996/clink fork.

chrisant996 avatar Sep 23 '20 06:09 chrisant996