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

password downshift problem #742

Closed
McThump opened this issue Aug 27, 2021 · 12 comments
Closed

password downshift problem #742

McThump opened this issue Aug 27, 2021 · 12 comments
Labels
bug Something isn't working Linux Related to the Linux operating system

Comments

@McThump
Copy link

McThump commented Aug 27, 2021

Hi,

I am using Espanso on Linux and created the following to enter complex passwords from the clipboard when remotely accessing Windows computers:

  - trigger: "c2k"
    replace: "{{clipboard}}"
    vars:
      - name: "clipboard"
        type: "clipboard"

Windows will not allow the pasting of passwords from the clipboard into the login box, but this Espanso match can enter them. The problem is that any uppercase characters in the clipboard are downshifted to lower case. So, for example, a password of "aAbBcC!@" is entered into the Windows password box as "aabbcc12". This problem only occurs for text inserted into password fields. Anywhere else is fine. I connect to these remote machines many times during the day. Getting this to work would be very helpful.

@federico-terzi
Copy link
Collaborator

Hey @McThump,

Thanks for reporting this issue! It seems like the remote access software is not passing the SHIFT events. What software are you using for remote access?

Cheers :)

@federico-terzi federico-terzi added bug Something isn't working Linux Related to the Linux operating system labels Aug 29, 2021
@McThump
Copy link
Author

McThump commented Aug 30, 2021

Hi @federico-terzi,

Yes. When I manually enter passwords using the keyboard there is no problem, but when they are inserted by Espanso the shift is not preserved. I am using AnyDesk and Remmina (for RDP connections) on Ubuntu for remote access and it happens with both of them. I tested this with Espanso on Windows 10 using the native Windows RDP client to remote to another Windows host. In this case, the shift is preserved and the problem does not occur.

@federico-terzi
Copy link
Collaborator

@McThump Interesting, thank you.

Does this problem happen also with other applications in the same remote session? I mean, I understand that you can't login because of this problem, but can you expand correctly on other applications inside the remote host?

@McThump
Copy link
Author

McThump commented Aug 31, 2021

@federico-terzi - Ah, excellent question! Yes, the problem occurs for all apps! So far, I had only been using it for password entry.

@federico-terzi
Copy link
Collaborator

@McThump I see, thank you! We'll investigate :)

@jtmackoy
Copy link

@federico-terzi, @McThump: I'm not sure exactly why this is happening, but I too had a similar problem and found a work-around.

I'm using a QEMU/KVM host (Pop!-OS 21.04) and run both Windows 10 and Windows 7 guests that leverage SPICE/QXL for displays and am using both virt-viewer and remote-viewer as clients. Like @McThump, I too was trying to simplify entering passwords in login prompts within these guests and was also experiencing the "downshifting" problem. This occurred anywhere text expansion was triggered inside of the Windows guests.

More specifically, if I were to have a bit of text like:
ThIsIsCoMpLiCaTeD!,>@;"
... it would end up expanded into the guest (irrespective of whether it was a password field or simply in notepad) like this:
thisiscomplicated1,.2;'

Thus, all "shift+character" keystrokes are converted to simply "character" ones.

Before using espanso, I used another utility for typing text in Linux hosts: xdotool. This tool simulates typing or mouse movement when using X11 as the host system's display server (doesn't work on wayland). Interestingly enough, using this in conjunction with an espanso shell extension match like this:

  - trigger: ":my_pw"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "xdotool type 'ThIsIsCoMpLiCaTeD!,>@;"'"
          trim: false

results in a successful expansion of :my_pw to ThIsIsCoMpLiCaTeD!,>@;" in a Windows guest.

As an aside, a reddit post led me to search for this issue in the repo. Cross-posting in case anyone else follows the same path I did.

@federico-terzi
Copy link
Collaborator

@jtmackoy Interesting! Thank you for sharing, this might be helpful to find a solution

@federico-terzi
Copy link
Collaborator

Hey guys!

I've investigated a bit on this issue. I think we'll probably need to create a few custom patches for these RDP apps, as I recently did for VirtualBox (see 8bab0f5#diff-e74564942afd14440713086d293920c28915cafe7578356232337b6c4d102415)

When you have the chance, could you please post here the detect information about your problematic clients? Here's a quick guide on how to get that information: https://espanso.org/docs/configuration/#finding-the-right-filters

With your help, we can bundle these edge cases into the new v2 version, so that hopefully this will work out-of-the-box :)

@jtmackoy
Copy link

jtmackoy commented Dec 17, 2021

Hey @federico-terzi!

Sorry for the delay, here's the info on the client I'm using for this issue, with some personal info <snip>'d out:

Detected change, current window has properties:
==> Title: '<snip> - Remote Viewer'
==> Class: 'Remote-viewer'
==> Executable: ''

Interestingly, the Executable path wasn't shown, however; I can confirm that for you manually:

whereis remote-viewer
remote-viewer: /usr/bin/remote-viewer

Hope this helps with your filter work.

BTW, just tried the the 2.1.1-alpha version and my workaround broke there. Will open a separate issue on that. Opened #912 for that.

@federico-terzi
Copy link
Collaborator

@jtmackoy Thanks! Sorry for the late reply

BTW, just tried the the 2.1.1-alpha version and my workaround broke there. Will open a separate issue on that. Opened #912 for that.

Could you please try adding a $CONFIG/config/remote-viewer.yml file with this content:

filter_class: "Remote-viewer"

backend: Inject
key_delay: 10
inject_delay: 15
disable_x11_fast_inject: true

And see if that helps?

If that works, we can integrate the patch into Espanso itself

Cheers :)

@ajkerrigan
Copy link

Being a bit of an issue necromancer here - I was seeing this lowercasing issue while using triggers in vim (either locally or on remote machines via SSH).

disable_x11_fast_inject: true reliably got espanso to start sending those shift keypresses, and the *_delay settings prevented the shift from affecting more characters than intended. Thank you @McThump for filing this issue and @federico-terzi for the effective workaround ❤️

@smeech
Copy link
Collaborator

smeech commented Feb 13, 2024

x11_use_xdotool_backend may also be helpful for these cases.

@smeech smeech closed this as completed Feb 13, 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 Linux Related to the Linux operating system
Projects
None yet
Development

No branches or pull requests

5 participants