You are not logged in.

#1 2014-09-15 11:18:46

mystyfly
Member
Registered: 2013-03-25
Posts: 30

[Solved] Problems with terminal

Hello everyone, I have 3 issues when working from a terminal. 2 of these have been discussed here, however the solutions provided there do not work for me. Also, the thread is over 2 years old so let me explain my own problems...

Firstly, line breaking doesn't seem to work properly. When a line exceeds the window width, it does get broken but instead of continuing on a new row, the current row is being overwritten. Like this:

 it should work!!n@thinkpad][~]$ this is not how 

This happends when using my usual xfce4-terminal but also on xterm. When using 'su' then only the first command I enter gets broken wrongly, but the following commands are broken properly onto new lines. Interestingly, it doesn't work when logging in as root on a tty.
I do have a fancy PS1 with colors and all but disabling those doesn't help. Also,

shopt -s checkwinsize

in .bashrc doesn't help, altough I didn't expect that to since the window width doesn't seem to be the issue here.

Secondly, deleting umlauts doesn't work. When typing a command that contains an umlaut (like in a path) and I delete it (doesn't matter whether by using delete or backspace) it is removed but the resulting command contains a question mark in a diamond - like this:

bash: foo: command not found

Here I entered "föo", deleted "ö" and added another "o". The question-mark-diamond is after the "f" in "foo".
This problem appears exactly the same when logging on tty as root but when entering 'su' then I see that, apparently umlauts consist of two codes ("\303\266" for "ö") and that only the latter code is being removed (and "\303" remains). How can I get rid of this?

Thirdly, an issue I am not quite sure how it's caused. The only place where I'm certain it appears every time is when watching a video on VLC. If I finish watching a video I want to remove it so I use the "up"-arrow to get the previous command, press "home", enter "rm" and press "delete" three times so I get

rm /path/to/video

. However, whenever a character of the command is altered, the whole line is copied to the line *above*. This is how it may look:

[0x209b148] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0  ✓][13:10][me@thinkpad][/data/video]$ rm^C accept value "0"
[130✗][13:11][me@thinkpad][/data/video]$ 
[0  ✓][13:10][me@thinkpad][/data/video]$ rmlc misc/VID_20140802_113808.mp4 
[0  ✓][13:10][me@thinkpad][/data/video]$ rmvlc misc/VID_20140802_113808.mp4 
 0  ✓][13:10][me@thinkpad][/data/video]$ rvlc misc/VID_20140802_113808.mp4 
[0  ✓][13:10][me@thinkpad][/data/video]$ vlc misc/VID_20140802_113808.mp4

When I delete "vlc" before entering "rm" then this doesn't happen, however my cursor is on one of the lines above like this:

Fontconfig warning: FcPattern object size does not accept value "0"
[0  ✓][13:12][me@thinkpad][/data/video]$ rm to resize display

Especially with problem 1 and 3 I don't even know what might be the cause. Any help is appreciated :-)

Last edited by mystyfly (2014-09-16 12:14:31)

Offline

#2 2014-09-15 18:00:26

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Problems with terminal

Check that your locale is correctly set. Make sure you aren't setting a TERM anywhere in your shell files and, just for kicks, paste your PS1 anyway...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-09-16 07:45:31

mystyfly
Member
Registered: 2013-03-25
Posts: 30

Re: [Solved] Problems with terminal

About setting the locale "correctly", that has been quite tricky, I eventually copied the settings from a friend which worked. How would I make sure that it is correct?


I never (on purpose) set TERM anywhere. This is info that was posted in the other thread as well:

$ set | grep -i termCOLORTERM=xfce4-terminal
TERM=xterm
_terms () 
    COMPREPLY+=($( compgen -W         "$( sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap             2>/dev/null )" -- "$cur" ));

I'm not really sure what that means, especially the "_terms" function...

My PS1 (with welcome text):

echo -e '\e[0;37m'Welcome to the '\e[1;34m'other side'\e[0;37m'...
echo ''

PS1="\[\033[1;30m\][\[\033[01;37m\]\$?\$(if [[ \$? == 0 ]]; then echo \"  \[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi)\[\033[1;30m\]][\[\033[1;37m\]\A\[\033[1;30m\]][\[\033[1;37m\]\u\[\033[1;30m\]@\[\033[1;37m\]\h\[\033[1;30m\]][\[\033[1;37m\]\w\[\033[1;30m\]]\[\033[1;34m\]\$\[\033[0;37m\] "

I don't think the PS1 is the problem, since the problems persist when logging in as root. I have that "\[ ... \]" since I'm using colors.

Does this help somehow?

Offline

#4 2014-09-16 07:51:41

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Problems with terminal

Read the wiki page to correctly set your locale; "copied the settings from a friend" doesn't sound all that promising...

Grep your shell initialization files for TERM: make sure you aren't forcing it anywhere.



That PS1 is ridiculous.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-09-16 07:55:40

mystyfly
Member
Registered: 2013-03-25
Posts: 30

Re: [Solved] Problems with terminal

I've had issues with the locale all the time and that was the first config that seemed to work for me. Will recheck that though. That might fix the delete-umlaut-problem but I don't see how that would impact the other two. How might those be caused?

What do you mean by forcing TERM?

Haha that PS1 mostly consists of various parts found in the Wiki page here big_smile

Offline

#6 2014-09-16 08:01:59

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Problems with terminal

Forcing the term would be setting `export TERM=xterm` or something like that in one of your shell start up files (.bashrc etc).

Replace the PS1 with the vanilla one and try and replicate.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-09-16 12:14:11

mystyfly
Member
Registered: 2013-03-25
Posts: 30

Re: [Solved] Problems with terminal

Awesome, thanks! Turns out that the locale was indeed the problem. I recently reinstalled arch and often used config files that worked in my previous installation, like locale.gen. However, it seems I forgot to copy locale.conf. Adding that did the trick, removing umlaute works properly now.

The other two problems were fixed that way as well: They were apparently caused by the tick/cross mark I used in PS1 depending on the exit code of the previous command. I used their unicode (I think) which, combined with the faulty locale, caused the problems. My monster PS1 works properly again wink

Offline

Board footer

Powered by FluxBB