We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

SSH garbled text

asked 2020-04-04 18:59:32 +0200

ds1979 gravatar image

Dear Sailors,

I have garbled text/characters via ssh. As I use SSH to connect to other types of devices, I can confirm, that it happens only on SSH to my Sailfish X device. (Xperia 10 DualSIM)

The screenshot shows an adoption of the serbian keyboard for SFOS. The same happens with cyrillic letters. screenshot through ssh

When using vi locally, it works quite fine. But working on the terminal is not funny with the tiny little keyboard. screenshot on the device

Please advise, how to "repair" this.

Thank you!

edit retag flag offensive close delete

Comments

I've only experienced this when using nano as my preferred editor, not vi. Also I am still using Jolla1 (3.3.0).

Spam Hunter ( 2020-04-04 19:07:57 +0200 )edit

I see something like that if the remote machine has LANG set to something non utf...

A.Maretzek ( 2020-04-04 20:40:52 +0200 )edit

echo $LANG

says: de_DE.utf8

ds1979 ( 2020-04-05 00:56:02 +0200 )edit

If you do file YOUR_FILE does it say "UTF-8 Unicode text"?

A.Maretzek ( 2020-04-05 01:14:43 +0200 )edit

Yes, it does say "UTF-8 Unicode text".

ds1979 ( 2020-04-17 09:58:12 +0200 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2020-04-05 12:22:05 +0200

Direc gravatar image

updated 2020-04-05 12:39:48 +0200

It looks like LANG environmental variable isn't set when SSH connection is opened. This can be checked by running locale after login. I had to do export LANG=fi_FI.utf8 (your locale may vary) and after that I could open text files with Scandinavian letter properly. Before that they were garbled mess.

EDIT: I decided to post my findings here instead, it's not worth opening a new question. Here are the differences between on-device terminal env and SSH env (truncated for readability):

[nemo@jolla-matti ~]$ diff localenv.txt remoteenv.txt 
--- localenv.txt
+++ remoteenv.txt
@@ -1,31 +1,21 @@
-AG_PROVIDERS=/usr/share/accounts/providers
-AG_SERVICES=/usr/share/accounts/services
-AG_SERVICE_TYPES=/usr/share/accounts/service-types
-BOOTSTATE=USER
-GIO_LAUNCHED_DESKTOP_FILE_PID=19647
-LANG=fi_FI.utf8
-LIPSTICK_OPTIONS=-plugin evdevtouch:/dev/input/event0:rotate=0 -plugin evdevkeyboard:keymap=/usr/share/qt5/keymaps/boston.qmap
+LAST_LOGIN_UID=100000
-MANAGERPID=1373
-NGF_FFMEMLESS_SETTINGS=/usr/share/ngfd/plugins.d/ngf-vibra-sbj.ini
-NOTIFY_SOCKET=/run/user/100000/systemd/notify
-PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/nemo/bin
+PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nemo/bin
-QTCONTACTS_MANAGER_OVERRIDE=org.nemomobile.contacts.sqlite
@@ -37,15 +27,17 @@
-QT_WAYLAND_COMPOSITOR_NO_THROTTLE=1
-SESSION_TARGET=default.target
+SSH_CLIENT=192.168.x.x xxxxx 22
+SSH_CONNECTION=192.168.x.x xxxxx 192.168.x.x 22
+SSH_TTY=/dev/pts/0
-_=/usr/bin/env
+XDG_SESSION_ID=c11
+_=/bin/env

There are many reasonable differences, but LANG, PATH and NOTIFY_SOCKET are the three that caught my eye the most. The desired export LANG=fi_FI.utf8 can be easily enough added to ~/.bash_profile but in my opinion that should be automatically handled.

edit flag offensive delete publish link more

Comments

This is the case in 3.2.1.20 and 3.3.0.14, can't check others.

A.Maretzek ( 2020-04-05 15:14:37 +0200 )edit

I'm planning on flashing my Jolla Phone to SFOS 2.2.x and testing with it.

Another question arose from this: does this affect SDK and app deployment, too?

Direc ( 2020-04-05 15:55:42 +0200 )edit
1

answered 2020-04-17 10:00:57 +0200

ds1979 gravatar image

updated 2020-04-17 19:15:22 +0200

olf gravatar image

I have found my workaround, thanks to @llelectronics:

LC_ALL=de_DE.UTF-8 vi filename

does the trick.

How can I make this permanent?

Made it permanent. I have put:

export LANG=de_DE.UTF-8

into the file /home/nemo/.bash_profile

edit flag offensive delete publish link more

Comments

Answer is given just above by direc
https://together.jolla.com/question/224534/ssh-garbled-text/?answer=224592#post-id-224592
Put this into ~/.bash_profile
or probably ~/.bashrc ?

peterleinchen ( 2020-04-17 10:55:58 +0200 )edit

What exactly?

ds1979 ( 2020-04-17 11:17:26 +0200 )edit

Your 'trick' just above ;)

Add this line
export LC_ALL=de_DE.UTF-8
to mentioned file, one of them.

And let us know which one worked for you.

peterleinchen ( 2020-04-17 11:52:19 +0200 )edit

How can I strike through the text "How can I make this permanent?"

ds1979 ( 2020-04-17 12:40:52 +0200 )edit
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2020-04-04 18:59:32 +0200

Seen: 348 times

Last updated: Apr 17 '20