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

Ubuntu 1804 - Default 'locale' setting results in portability issues because response to prompts are required to be UPPER case only! #3516

Closed
mi-hol opened this issue Aug 31, 2018 · 6 comments
Labels

Comments

@mi-hol
Copy link

mi-hol commented Aug 31, 2018

Windows build number: Microsoft Windows [Version 10.0.17134.228]
with Ubuntu 1804 distribution and Windows host set to 'culture' German (Germany) but Windows UI language = English(US)

Get-Culture

LCID             Name             DisplayName
----             ----             -----------
1031             de-DE            German (Germany)
  • What you're doing and what's happening:
    PowerShell commands requiring a confirmation only accept UPPER case response

  • What's wrong / what should be happening instead:
    confirmations are case insensitive.
    This has the impact of case in-sensitive powershell scripts suddenly being CASE sensitive for prompts. Meaning portability is lost!

  • Steps required to reproduce

  1. install Ubuntu 1804
    =>results in a strange locale 'en-US-POSIX' that I was unable to change!

  2. install powershell-preview RC1 according to:
    https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-linux?view=powershell-6#ubuntu-1804

# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

# Register the Microsoft Ubuntu repository
sudo curl -o /etc/apt/sources.list.d/microsoft.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list

# Update the list of products
sudo apt-get update

# Install PowerShell
sudo apt-get install -y powershell-preview

# Start PowerShell
pwsh-preview
Get-Culture
Set-Content foo.txt -Value "hi" ; $ConfirmPreference="low"; Remove-Item foo.txt

2018-08-24 10_10_23-window

Confirmation that standard Ubuntu 18.04 in a VM doesn't show this issue
PowerShell/PowerShell#7639
due to a different LCID.
Also issue does NOT appear in Ubuntu 1704!
I failed to set a different locale due to error

sudo localectl
Failed to create bus connection: No such file or directory
@mi-hol
Copy link
Author

mi-hol commented Aug 31, 2018

could be related to #3018

@therealkenc
Copy link
Collaborator

could be related to #3018

Probably not directly unless WSLENV is in play somehow here, which I don't think it is. The problem over there is a pretty specific bad interaction.

sudo localectl

That isn't going to work because no systemd

install Ubuntu 1804
=>results in a strange locale 'en-US-POSIX' that I was unable to change!

No need to yell.

$ sudo locale-gen de_DE.UTF-8
$ sudo update-locale LANG=de_DE.UTF-8

image

Notably enough, whatever behavior PowerShell exhibiting with en-US-POSIX (assuming it is even incorrect behavior) is going to be the same on Real Linux

@mi-hol
Copy link
Author

mi-hol commented Nov 30, 2018

Thanks @therealkenc
Good to have a workaround but what really concerns me is the different behavior of WSL Ubuntu1704 and WSL Ubuntu1804 in this matter.

PS: not sure to understand your comment 'No need to yell.'

@therealkenc
Copy link
Collaborator

therealkenc commented Nov 30, 2018

but what really concerns me is the different behavior of WSL Ubuntu1704 and WSL Ubuntu1804 in this matter.

The launcher changed between 16.04 and 18.04 may be the cause of this (analogous to but different than #3273). There is no difference in WSL behavior, and WSL does not control Ubuntu behavior.

PS: not sure to understand your comment 'No need to yell.'

Ausrufezeichen übersetzt schlecht

@mi-hol
Copy link
Author

mi-hol commented Nov 30, 2018

Symbolische Bedeutungen aus https://de.wikipedia.org/wiki/Ausrufezeichen
Das Ausrufezeichen steht allgemein für ‚wichtig‘, insbesondere für eine Warnung (‚Achtung‘), oder für ‚Gefahr‘ und ‚Gefährdung‘.
Achtung vor Gefahr! (Straßenverkehr, international üblich)

image

@therealkenc
Copy link
Collaborator

That road sign translates badly too. I changed my locale to en_CA and all I got was:

image

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

No branches or pull requests

2 participants