WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] Any working terminal / shell for Unicode?  (Read 2583 times)

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
[SOLVED] Any working terminal / shell for Unicode?
« on: June 19, 2013, 04:44:16 AM »
I know this has been asked already, and the answer usually is: urxvt, aka. rxvt-unicode. In short, I want a terminal where Unicode is working properly.

urxvt is indeed better than aterm:
Code: [Select]
URXVT:
tc@tinycore:/mnt/sdb1/Tan$ ls *é*
Plan général du réseau 2012-2013.pdf
ATERM:
tc@tinycore:/mnt/sdb1/Tan$ ls *é*
Plan général du réseau 2012-2013.pdf

…BUT…

Let me display all keystrokes, and their result:
Code: [Select]
KEYS: ls *é
tc@tinycore:/mnt/sdb1/Tan$ ls *é
KEY: <backspace>
tc@tinycore:/mnt/sdb1/Tan$ ls *
KEY: <enter>
tc@tinycore:/mnt/sdb1/Tan$ ls *
ls: cannot access *Ã: No such file or directory

What happens is that <backspace> deletes a byte from the command line instead of deleting a character, even though the display properly reports a deleted character. One can do fun thing like this:
Code: [Select]
KEYS: rmdir test.pdf<enter>
tc@tinycore:/mnt/sdb1/Tan$ rmdir test.pdf
rmdir: failed to remove `test.pdf': Not a directory
KEYS: rm é
tc@tinycore:/mnt/sdb1/Tan$ rm é
KEYS: <backspace><backspace>dir test.pdf<enter>
tc@tinycore:/mnt/sdb1/Tan$ rmdir test.pdf
rm: cannot remove `dir': No such file or directory
rm: remove regular file `test.pdf'? n
You can even remove the prompt by typing enough multi-byte characters, then backspacing all those bytes…

Is there some way urxvt can be made to behave properly? Else what is the most light-weight terminal with the proper behaviour?

[edit: added “ / shell” to the topic title for future reference… (forum search)]
« Last Edit: June 19, 2013, 11:51:57 PM by theYinYeti »

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: Any working terminal for Unicode?
« Reply #1 on: June 19, 2013, 06:05:14 AM »
That seems to be my problem: http://www.mail-archive.com/linux-utf8@nl.linux.org/msg01645.html
If I understand correctly, the problem lies in urxvt incorrectly translating the <backspace> keypress into the adequate number of <BS> TTY bytes.

I’m still in search for a workaround or an alternative…

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: Any working terminal for Unicode?
« Reply #2 on: June 19, 2013, 06:29:24 AM »
Further testing showed to me that the UTF-8-aware “st” terminal has the same problem. Strange, thought I…
Actually, I found that the problem lies with the default shell: busybox sh. All is fine with bash.

So, now, how do I make TinyCore boot to an UTF-8-friendly shell, be it bash or another?

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: Any working terminal for Unicode?
« Reply #3 on: June 19, 2013, 11:49:53 PM »
OK; solved. I just wrote “export SHELL=/usr/local/bin/bash” in an executable file inside ~/.X.d/. This allows for using bash when in X11 while still keeping the busybox shell by default on the console; this way, even with a “base” configuration (no auto-load of bash and no X11), I don’t risk having a non-existent shell defined in /etc/passwd, and besides I don’t have to play with the /etc/shells file ;-)