Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Weird and annoying tty behaviour, need help.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
tarcisioe
n00b
n00b


Joined: 17 Jun 2013
Posts: 2

PostPosted: Mon Jun 17, 2013 8:07 am    Post subject: Weird and annoying tty behaviour, need help. Reply with quote

Hello there, I need some help!

I am currently running a Gentoo server on my workplace. It has no X server, and is therefore being configured only on text mode or over ssh.

I am getting really weird character behaviour, though. For example, on the shell, I get this output for this command.

Code:
$ echo á
á


Which is of course, perfectly normal. If I input a non-ASCII character (like 'á' for example) and then erase it using backspace, I get this really weird behaviour:

Code:
$ echo 
Ã


Not only that, if I input a non-ASCII character, it enables me to actually backspace PAST my prompt, making it go from

Code:
user@server $ áááá


to

Code:
user@serve


The characters are displayed correctly and apparently erased accordingly, but it would seem that backspace is only erasing half the long character, or something like that.

The keymap is set to 'br-abnt2' (though using it through ssh on my dvorak laptop it presents exactly the same symptoms, through my urxvt). It doesn't seem like a consolefont problem, because I can actually get the characters properly displayed.

'unicode' is set to YES on rc.conf.

LC_ALL is set to pt_br.UTF-8 in /etc/env.d/02locale.

The unicode useflag is also properly set in /etc/make.conf.

This is of course really annoying, because any mistyping of a non-ASCII character actually makes the command invalid, because half the character seems to remain there. It also affects text editing. I even made a program to measure the size of an input string, and it gave me for 3 for "aç" and 2 for "a", which was actually "aç" and a backspace. The same program gives me the (correct) answers 3 and 1, respectively, on my laptop, which is normal and set, apparently, to the same configs.

I tried everything I thought could affect this kind of thing, but nothing seemed to help, so please bless me with knowledge.

Thanks in advance!
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Mon Jun 17, 2013 10:32 am    Post subject: Reply with quote

Also observed this strange behavior: Nothing but exit and login again.

You could experiment in ~/.inputrc
Change some of these defaults:
Code:
set bind-tty-special-chars On
set convert-meta On
set echo-control-characters On
set enable-meta-key On
set input-meta Off
set keymap emacs   # vi vi-insert as alternatives like:
set editing-mode emacs
set output-meta Off

See the full list:
Code:
man bash
/
Readline Variables
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Jun 17, 2013 1:25 pm    Post subject: Reply with quote

run 'locale -a'. Does it show 'pt_br.UTF-8'? If not, set your locale variables to one of the values shown by 'locale -a'.

Additionally, try setting environment variables LANG and LANGUAGE to one of the values shown by 'locale -a'.

On my system, I have:

Code:
LANG="de_DE.utf8"
LANGUAGE="de_DE.utf8"
LC_ADDRESS="de_DE.utf8"
LC_COLLATE="POSIX"
LC_CTYPE="de_DE.utf8"
LC_IDENTIFICATION="de_DE.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_MESSAGES="de_DE.utf8"
LC_MONETARY="de_DE.utf8"
LC_NAME="de_DE.utf8"
LC_NUMERIC="de_DE.utf8"
LC_PAPER="de_DE.utf8"
LC_TELEPHONE="de_DE.utf8"
LC_TIME="de_DE.utf8"
Back to top
View user's profile Send private message
tarcisioe
n00b
n00b


Joined: 17 Jun 2013
Posts: 2

PostPosted: Mon Jun 17, 2013 7:26 pm    Post subject: Reply with quote

Setting LANG and LC_ALL to "pt_BR.utf8" (lowercase, no "-") solved it! Thanks man :D

No idea why the locale is named like that, it says "pt_BR.UTF-8 UTF-8" in my /etc/locale.gen, but now everything works fine, so it's ok :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum