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 type backslash (clink issue) #89

Closed
r3Fuze opened this issue Dec 15, 2013 · 23 comments
Closed

Can't type backslash (clink issue) #89

r3Fuze opened this issue Dec 15, 2013 · 23 comments
Labels
👆 clink Upstream issue in clink.

Comments

@r3Fuze
Copy link

r3Fuze commented Dec 15, 2013

You can't create backslashes \ with clink enabled.
One way to fix this is to create a clink_inputrc file in /settings containing
M-\: "\\"

This will unbind "delete_horz_space" though.
Clink issue: https://code.google.com/p/clink/issues/detail?id=138

@JefClaes
Copy link

I have the same issue. I don't know what clink is though?

@vcaraulean
Copy link

@JefClaes & anyone
cmder's installation folder contains a "config" folder. Follow @r3Fuze 's recommendations - create a clink_inputrc file and add edit the file to contain that line.

@Stanzilla Stanzilla added the 👆 clink Upstream issue in clink. label Oct 12, 2015
@MartiUK
Copy link
Member

MartiUK commented Oct 16, 2015

Issue is closed upstream.

@MartiUK MartiUK closed this as completed Oct 16, 2015
@Sopor
Copy link

Sopor commented Jun 17, 2023

Is this issue still not fixed (the link to code.google is dead)?

I can't type backslash, but i can copy it from another window and paste it in Cmder.

I have tried the suggestion here, but that will not help 😒

@daxgames
Copy link
Member

I type back slashes every day.

@chrisant996
Copy link
Contributor

Is this issue still not fixed (the link to code.google is dead)?

I can't type backslash, but i can copy it from another window and paste it in Cmder.

I have tried the suggestion here, but that will not help 😒

Please share your .inputrc file.

There is almost certainly a typo in a key binding there.

@Sopor
Copy link

Sopor commented Jun 18, 2023

Now i know what the problem is.

I use OSK (On-Screen Keyboard) and that seems to cause this problem.

Where should i open an issue for this problem, Cmder or Clink?

@chrisant996
Copy link
Contributor

chrisant996 commented Jun 18, 2023

Now i know what the problem is.

I use OSK (On-Screen Keyboard) and that seems to cause this problem.

Where should i open an issue for this problem, Cmder or Clink?

Open a new issue in https://github.com/chrisant996/clink/issues. If it turns out to be not related to Clink, then you can open an new issue elsewhere.

Here are some thoughts, though:

For me, Backslash works fine from the Windows On-Screen Keyboard with Clink in Windows Terminal, ConEmu, Cmder, and the legacy default console host. I'm using Windows 10.

Try this -- it will show whether Clink is receiving the right input signals from the operating system and/or ConEmu:

  1. In the Cmder window, run clink echo --verbose.
  2. Press Backspace.
  3. Copy the output and paste it here.
  4. (when finished, press Ctrl-C to return to the command prompt)

Also:

  • How did you determine that On-Screen Keyboard is the source of the problem?
  • What other keyboard-related tools are in use?
  • What version of Clink are you using? (run clink info and it will say)

It could still be useful to share your .inputrc file. Last time I helped someone for whom a key wasn't working, it turned out to be caused by a mistake in their inputrc file. For example, if your inputrc file contains something like \dir\program --flags then that would unbind the Backslash key, because that's a command line and would get misinterpreted as a key binding since it's in the inputrc file (where key bindings go, not commands).

@Sopor
Copy link

Sopor commented Jun 18, 2023

For me, Backslash works fine from the Windows On-Screen Keyboard with Clink in Windows Terminal, ConEmu, Cmder, and the legacy default console host. I'm using Windows 10.

What keyboard layout do you use? It seems that you use american keyboard layout. I need to use AltGr to get the backslash.

  • How did you determine that On-Screen Keyboard is the source of the problem?
  • What other keyboard-related tools are in use?
  • What version of Clink are you using? (run clink info and it will say)
  • It works when i use my keyboard.
  • None
  • 1.4.27.733e84

Try this -- it will show whether Clink is receiving the right input signals from the operating system and/or ConEmu

key event:  _CA A_  flags=0x0000002b  char=0x005c  vk=0x00bb  scan=0x000c  "+"
"\e[27;7;187~"

It could still be useful to share your .inputrc file.

I don't even know where that file is located.

Why should something be wrong in that file after installing Cmder?

I noticed this problem after 10 minutes of using Cmder and i haven't change anything.

@chrisant996
Copy link
Contributor

What keyboard layout do you use? It seems that you use american keyboard layout. I need to use AltGr to get the backslash.

@Sopor I need to know your keyboard layout. Based on your github profile, I'm guessing maybe it's the "Svenska (Swedish)" keyboard layout. And I'm able to reproduce the issue using that keyboard layout.

When I run clink set terminal.use_altgr_substitute true then backslash works from both the physical keyboard and the OSK.

Both say the Left Ctrl and Right Alt keys are pressed.
The OSK also says the Left Alt key is pressed.

I'll investigate this more and look for a solution that doesn't have too many drawbacks.

Try this -- it will show whether Clink is receiving the right input signals from the operating system and/or ConEmu

key event:  _CA A_  flags=0x0000002b  char=0x005c  vk=0x00bb  scan=0x000c  "+"
"\e[27;7;187~"

Great, thanks. Now that I know your keyboard layout and how you're reproducing the issue, I can investigate on my own without needing to ask further questions.

It could still be useful to share your .inputrc file.

I don't even know where that file is located.

Why should something be wrong in that file after installing Cmder?

I got this problem after 10 minutes of using Cmder and i haven't change anything.

The .inputrc file is used by various Linux programs, and sometimes there are unexpected stray copies around that came from something else. So it's a question I have to ask as part of the troubleshooting process.

I had no way to know that you hadn't created an inputrc file or that you just now installed Cmder, so asking the question was an important step. Questions may seem dumb, but they're necessary to find out more about the situation. The more information available in an initial problem report, the fewer questions need to be asked while troubleshooting.

Running clink info says from where (if anywhere) an inputrc file was loaded.

@chrisant996
Copy link
Contributor

(Oh, also, Windows Terminal is not correctly supporting Ctrl-Alt substitute for AltGr right now, at least when switching keyboard layouts on the fly with Win-Space. That was making it extra confusing, at first, to debug what was going wrong.)

@Sopor
Copy link

Sopor commented Jun 18, 2023

AltGr should be the same as pressing CTRL and ALT. I did try both ways in Cmder, but none of them worked.

@Sopor

This comment was marked as off-topic.

@Sopor
Copy link

Sopor commented Jun 18, 2023

Running clink info says from where (if anywhere) an inputrc file was loaded.

inputrc  : %clink_inputrc%
             (unset)

@chrisant996
Copy link
Contributor

AltGr should be the same as pressing CTRL and ALT. I did try both ways in Cmder, but none of them worked.

They're intended to behave the same. But at the low level inside the OS, they are definitely not the same, which is why sometimes there are problems with the AltGr substitute handling in various programs (Windows Terminal has had problems off and on with it, and Clink has had various problems with it, and so have many other programs).

Anyway, I'm working on a solution. I'll use the issue in the Clink repo for further updates.

@chrisant996
Copy link
Contributor

Fixed in Clink v1.4.28.

@Sopor
Copy link

Sopor commented Jun 19, 2023

Fixed in Clink v1.4.28.

That was a quick fix, nice! 👍

@chrisant996
Btw, when i updated Clink i was forced to restart Cmder. Is that normal?

Shouldn't there be a message telling the user to restart Cmder if that is necessary to apply the update?

@chrisant996
Copy link
Contributor

@chrisant996
Btw, when i updated Clink i was forced to restart Cmder. Is that normal?

Can you describe more specifically about "I was forced to restart Cmder"?

Do you just mean that to use the updated Clink you had to open a new tab in Cmder?

Shouldn't there be a message telling the user to restart Cmder if that is necessary to apply the update?

"Restart Cmder" isn't necessary to apply the update. What "forced" a restart?

Also, Clink can't really predict which things (or how many) you might have open that are running CMD.exe instances.

I don't understand what is meant by "forced to restart Cmder", so I don't know how to respond other than to ask for clarification.

@Sopor
Copy link

Sopor commented Jun 19, 2023

I don't understand what is meant by "forced to restart Cmder", so I don't know how to respond other than to ask for clarification.

When i read that you had fixed the issue with backslash i started Cmder and updated it by running clink update.

After the update there was no message telling me that i should restart Cmder and therefore i thought i could continue and that the backslash now should work, but when tried to type backslash it didn't worked.

So, i closed the Cmder window and opened it again and now i could type the backslash.

@daxgames
Copy link
Member

Perhaps it might make sense for clink update to tell the user to restart all terminals.

@chrisant996
Copy link
Contributor

chrisant996 commented Jun 19, 2023

From Sopor:

When i read that you had fixed the issue with backslash i started Cmder and updated it by running clink update.

After the update there was no message telling me that i should restart Cmder and therefore i thought i could continue and that the backslash now should work, but when tried to type backslash it didn't worked.

I see. What's a little unusual about Clink is that it doesn't force you to close everything first (there are important technical reasons, as well as functional reason, but that gets into a long topic).

But when updating any software, you don't get the results of the update in any instances that are already running. That's universal in computing.

So, i closed the Cmder window and opened it again and now i could type the backslash.

You didn't need to close Cmder. You could have opened a new tab. That's part of what I mean about "nothing forces restarting Cmder". You don't have to restart ConEmu (the Cmder frame window). And you don't need to restart cmd.exe tabs/windows/etc unless you absolutely need something in the update.

It would be misleading to say "you must restart all terminal hosts and integrated development environments and anything else that might be using cmd.exe". I don't want to get sucked into trying to explain all that context and what's required and what isn't, all in a one-sentence message added on to the existing output from clink update.

From daxgames:

Perhaps it might make sense for clink update to tell the user to restart all terminals.

That wouldn't be accurate. Restarting terminals hosting bash or powershell or cmd-without-clink is unnecessary. Even restarting cmd.exe instances that do have clink installed isn't "necessary" after updating -- it's only necessary if you want to immediately experience the updates.

Also, the more documentation is printed on every clink update, the more verbose and annoying it becomes.

What I Can Consider

I can consider adding more output from clink update to mention that the updates will take effect in new cmd.exe windows that are launched. Again, I'm concerned about printing too much text. As we all know, the more text is printed, the less likely any of it is to be read.

@Sopor
Copy link

Sopor commented Jun 19, 2023

You didn't need to close Cmder. You could have opened a new tab.

If i close and re-open Cmder or open a new Cmder window is the same thing in my opinion.

What i wanted to say with my comment was that when i didn't get any message that i needed to open a new Cmder window i assumed everything should work after an update (the issue was fixed and it should work in the window that was already open).

I have been using computers since the 80s and nothing is obvious.

There are not two developers that are thinking the same thing and it is impossible to know how they are thinking.

You can do as you like. Now i know how it works when i do an update 🙂

@chrisant996
Copy link
Contributor

You didn't need to close Cmder. You could have opened a new tab.

If i close and re-open Cmder or open a new Cmder window is the same thing in my opinion.

If someone only has one tab open, then they're close to being the same.

But what if someone has 5 tabs open in Cmder with PowerShell, and 1 tab with CMD+clink?

Closing Cmder is not the same as closing 1 tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👆 clink Upstream issue in clink.
Projects
None yet
Development

No branches or pull requests

8 participants