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

AWS SSM Plugin for aws-cli don't work correctly with spanish (from Spain) Keyboard layout #13

Open
MarckFp opened this issue Sep 15, 2021 · 21 comments

Comments

@MarckFp
Copy link

MarckFp commented Sep 15, 2021

Connecting with a instance with the AWS SSM plugin on Windows 10 with the Spanish (from Spain) Keyboard layout using CMD and PowerShell (v 5.1 and 7.4) some characters are not recorded correctly, characters like ? @ }

@diddi-
Copy link

diddi- commented Oct 19, 2021

I'm experiencing the same thing (although using Swedish keyboard layout). A possible workaround is to

  • Switch to English keyboard layout
  • Connect to the host using SSM plugin

Optionally, if you don't want to stay on English layout:

  • Type a single character (any character on the keyboard)
  • Switch back to your native keyboard layout

Simply connecting with English layout and then switching back does not seem to be enough, only after sending the first character you can switch back and it will work until the session is closed. This needs to be repeated for each new session.

This was tested on
AWS CLI: aws-cli/2.2.46 Python/3.8.8 Windows/10 exe/AMD64 prompt/off
SSM Plugin: 1.2.245.0

@schwichti
Copy link

Same problem here with German keyboard layout. For example, the opening square bracket has the effect of "backspace".

@dmazuronak
Copy link

Same problem with German layout. Workaround doesn't help at all.
German characters 'äöü' are displayed as '├ñ├Â├╝'.

Versions:
AWS CLI: aws-cli/2.7.8 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
SSM Plugin: 1.2.339.0

@jeffewald
Copy link

jeffewald commented Jul 29, 2022

As @dmazuronak mentioned the German Layout has same problems too.
My workaround is the following.

If i need a specific character like [ than i switch Layout to US English and start a new Session.
Problem here: US English do not have 'äöü'.

It might work for some small works but will be getting awful when you need to change the whole time.

@daivanov
Copy link

The same problem with
aws-cli/2.7.22 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
and
SSM 1.2.339.0

@gremila
Copy link

gremila commented Aug 20, 2022

Same issue with frensh keyboard, you have to switch the keyboard to type this kind of char event by copy past

@BornToBeRoot
Copy link

Same problem with { and [ (] and } does work) on a german keyboard...

It looks like the underlying library is causing the problem: https://github.com/eiannone/keyboard
However, the library is no longer actively maintained...

The plugin is unusable for me... although I would like to replace SSH with AWS SSM....

@BornToBeRoot
Copy link

@dmazuronak for me the ö, ä & ü is working when i use pwsh.exe (PowerShell 7) as console host. But not in Windows PowerShell or CMD

@dmazuronak
Copy link

I have had the opportunity to try out PowerShell 7. Unfortunately, I could not see any improvement.

@TeeFiX42
Copy link

Same issue with Belgian keyboard: Pressing the @ results in 'nothing'.
Copy/paste is not a viable workaround:

  1. Copy paste of an email address in the windows CMD prompt works.

  2. Copy paste of that same email address in the SSM ('aws ssm start-session --target ') results in the loss of the @

Still no fix?

@BornToBeRoot
Copy link

@TeeFiX42 removing 50 from this line should fix the @ for spain&belgian keyboard.

see #51

@BornToBeRoot
Copy link

BornToBeRoot commented Feb 7, 2023

Hi @dmazuronak,

i think the default input/output encoding in the console window is wrong. For me it worked on some powershell windows (e.g. Windows Terminal)....

If you set this in Powershell:

[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding

before connecting to aws ssm, you should be able to use öäü.

Edit:
For me the default was:

BodyName          : ibm850
EncodingName      : Westeuropäisch (DOS)

I changed it to utf8

@clienart-bmx
Copy link

Why is this still not patched ? Every time I have to type any command which contains ~#{[|`\ I have to switch to Qwerty and use the on-screen keyboard, it's a real pain !

The issue is known, and so is the fix, so what is Amazon waiting for ?

Please fix this !!!

@ngollan
Copy link

ngollan commented May 19, 2023

In case of German and other keyboards with AltGr keys, one offender is probably https://github.com/aws/session-manager-plugin/blob/7b544e9f381d809fd7117747d4b78b244addcf1e/vendor/src/github.com/eiannone/keyboard/keyboard_windows.go#LL96C5-L96C83

ctrlPressed := r.control_key_state&(left_ctrl_pressed|right_ctrl_pressed) != 0

which must not trigger if Alt is also pressed.

@ngollan
Copy link

ngollan commented May 23, 2023

As mentioned before, copy/paste is also broken. Pasting the string UTC [] : {"id" into an open session results in UTC"id".

@BornToBeRoot
Copy link

BornToBeRoot commented May 23, 2023

@ngollan you can clone my fix and build the binaries yourself if you want: https://github.com/BornToBeRoot/session-manager-plugin/tree/mainline

For me it's working fine with my own binaries ^^

Edit: I don't understand why AWS is not able to solve this problem that affects everyone who doesn't have an English keyboard.

@ngollan
Copy link

ngollan commented May 23, 2023

@BornToBeRoot does your change also fix pasting?

@BornToBeRoot
Copy link

@ngollan yes. Pasting { [ works for me.

I would also recommend doing this [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding in PowerShell to set UTF-8 before running aws ssm start-session.... Then you can also use öäü

@decatur
Copy link

decatur commented Jun 27, 2023

I get this on a german keyboard layout, i.e. square brackets are BACKSPACE.
This has serious operational risks, e.g. if you copy and paste code.
Currently we do not have any workaround. Other than not using aws ssm start-session.
I suggest to use vscode remote if you are on a MS-Windows client.

@angelo-gelmini
Copy link

angelo-gelmini commented Aug 3, 2023

The solution of forcing [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding in powershell resolve the problem of particular characters with accents but not the problem of @ character in Italian Keyboard (QWERTY).

@BornToBeRoot
Copy link

@angelo-gelmini the @ is related to #51

But no one at aws cares about this problem (i also wrote to the support...). This project does not seem to be maintained anymore and I have to ask myself if it makes sense to continue using the AWS Session Manager or if I would rather use SSH.

Also it's not a problem of the session manager plugin, but from the underlying go library which is not maintained...

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

No branches or pull requests