LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Terminal shows unicode squares for control characters (http://www.linuxquestions.org/questions/linux-software-2/terminal-shows-unicode-squares-for-control-characters-778324/)

ghostknife 12-27-2009 11:27 AM

Terminal shows unicode squares for control characters
 
My terminal shows unicode squares (the little square with it's 2 byte unicode value inside it), whenever I press a control character while running a program (ex. cat or ping).

See this example. Here I show the key's I pressed then turn off echoctl, and repeat the sequence. http://imagebin.ca/img/mXbutJ1.png

the 0003 is when I pressed Ctrl+C, and the 001A is when I pressed ctrl+z.

Can anybody tell me why this is or how to turn it off. This is inside a gnome-terminal session, though I don't think it's gnome-terminal.

If, inside this exact same bash session I open screen (by typing "screen"), it doesn't do this anymore, and ctrl+c/z/etc is completely quiet.

ozanbaba 12-27-2009 11:46 AM

what's output of echo $LANG

ghostknife 12-29-2009 04:53 AM

Thanks for the reply. This is frustrating and unusually difficult to solve for some reason.

To answer your question. My LANG is set to en_US.UTF-8. I set it to this in an attempt to solve the problem, to see if it makes a difference. Before it was on en_ZA.UTF-8, which is the configuration for all my machines (which work fine).

Again, if I were to run a screen session from the affected shell instance, the same LANG value exists, and the control characters are gone. Running the shell from tty1-6 works as intended as well.

It seems to be only the initial /bin/bash session when running through gnome-terminal.

ozanbaba 12-29-2009 10:56 AM

Quote:

Originally Posted by ghostknife (Post 3807674)
Thanks for the reply. This is frustrating and unusually difficult to solve for some reason.

To answer your question. My LANG is set to en_US.UTF-8. I set it to this in an attempt to solve the problem, to see if it makes a difference. Before it was on en_ZA.UTF-8, which is the configuration for all my machines (which work fine).

Again, if I were to run a screen session from the affected shell instance, the same LANG value exists, and the control characters are gone. Running the shell from tty1-6 works as intended as well.

It seems to be only the initial /bin/bash session when running through gnome-terminal.

maybe somehow stty is not unicode readdy.

ghostknife 12-30-2009 05:39 AM

Why do you think it's stty? Afterall, in a screen session or pure tty1-6 it works fine.

ozanbaba 12-30-2009 05:46 AM

Quote:

Originally Posted by ghostknife (Post 3808735)
Why do you think it's stty? Afterall, in a screen session or pure tty1-6 it works fine.

i don't have any problems in terminals as you do (do it console from tty1-6) or terminal emulator in X system (xfce4-terminal what i use).

if you send ^c to system and it shows characters, and not do what it suppose to do (die peacefully). some place it catch and interpreted wrong in some place. my prime suspect is stty right now.

maybe stty change the settings to something wrong.

PS: some reference information about LANG variable for future use by anybody. en_ZN.UTF-8; en is for language defining, ZN is country code and important for deciding which locale setting will be used. UTF-8 is default encoding.


All times are GMT -5. The time now is 09:53 PM.