You are not logged in.

#1 2014-08-25 20:37:59

astex
Member
Registered: 2012-06-25
Posts: 37

[SOLVED/UNEXPLAINED] Terminal incorrectly interprets encoding...

This is my fifth-ish install of arch; I'm not entirely hopeless. But, I've never had this problem before.

Having recently completed installing my new system, setting $LANG correctly, and running locale-gen as indicated in the install guide, I finally entered into my desktop and popped open an xterm only to find that a wide variety of commands just don't work.

[/home/astex astex@george_michael] % echo "this is a test" | grep test   127 =[
zsh: command not found:  grep

Kind of weird.  Maybe grep somehow didn't get installed?

[/home/astex astex@george_michael] % grep --version                        2 =[
grep (GNU grep) 2.20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

Huh.  The tty works fine.  What happens if I play with my encoding?  I switch ROXTerm to ISO-8859-1.

Hitting 'up':

[/home/astex astex@george_michael] % echo "this is a test" | grep test 127 =[
zsh: command not found:  grep

Typing anew:

[/home/astex astex@george_michael] % echo "this shouldn't help" | grep should
this shouldn't help

hmm...

[/home/astex astex@george_michael] % locale                                  =]
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

So to sum up, the locale is set to en_US.UTF-8 as it should be, but at some point, something is getting confused.  Commands after a pipe (or a few other characters, probably) don't work with the terminal emulator in UTF-8 mode.  These same commands do work if the emulator is set to ISO-8859-1 (though not if the command is pulled from history).  All commands work fine in the ttys.  This happens independently of which emulator is being used (I tried xterm, gnome-terminal, xfce4-terminal, and roxterm).  Anyone seen this before?

EDIT

After logging out of gnome, logging into awesome, trying things (successfully) there, logging out, and logging back into gnome, it works.  I didn't mention gnome above because it didn't seem likely to be the cause.  I'll update if I can trigger this weirdness again.

EDIT once more

After opening up a second terminal, things are back to their original non-functional state.

Last edited by astex (2014-08-25 21:30:24)

Offline

#2 2014-08-25 20:54:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,576
Website

Re: [SOLVED/UNEXPLAINED] Terminal incorrectly interprets encoding...

Do you use ibus or related input related tools for internationalization?  Have you tried this with no configs (e.g., bashrc)?

What is that symbol at the end of every line with the happy/sad face?  Is that part of a custom prompt?  If so, that would be my first suspicion.

EDIT: I just saw your edit.  If that pattern holds (this only happens in gnome) then the prompt would be off the hook and ibus or a related tool would be the prime suspect.

Last edited by Trilby (2014-08-25 20:55:15)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2014-08-25 21:00:10

astex
Member
Registered: 2012-06-25
Posts: 37

Re: [SOLVED/UNEXPLAINED] Terminal incorrectly interprets encoding...

I don't use ibus for anything or have it installed.  It is part of a custom zsh prompt, but the problem persists in an rc-less bash.  I was also able to launch a non-working terminal emulator in awesome.  The process went like this:

Launch 1 roxterm - works
Launch 2 roxterm - doesn't work
Launch 3 roxterm - doesn't work
Launch 4 roxterm - works
Launch 5 xterm - doesn't work
Launch 6 xterm - doesn't work
Launch 7 xterm - works
Launch 8 xterm - doesn't work

Logout

Log back in

Launch 9 roxterm - doesn't work

These were immediately following eachother with nothing done in between

Last edited by astex (2014-08-25 21:01:33)

Offline

#4 2014-08-25 21:04:51

astex
Member
Registered: 2012-06-25
Posts: 37

Re: [SOLVED/UNEXPLAINED] Terminal incorrectly interprets encoding...

This unusual situation just happened.  I called up a terminal that failed, exited it, started another one that worked, ran the command from the previous terminal from history, and it failed.

[/home/astex astex@george_michael] % echo "hi there" | grep hi               =]          # < Typed
hi there 
[/home/astex astex@george_michael] % echo "hi there" | grep hi               =]          # < From history
zsh: command not found:  grep

And after trying to run the errant command, typing it no longer works.

Last edited by astex (2014-08-25 21:05:57)

Offline

#5 2014-08-25 21:29:04

astex
Member
Registered: 2012-06-25
Posts: 37

Re: [SOLVED/UNEXPLAINED] Terminal incorrectly interprets encoding...

Some amount of digging later, I found in gnome-tweak tool that the key "Use space key to insert non-breaking-space" was set to something other than disabled (not sure why or how).  After disabling that, things seem to work correctly.  I don't know why that would affect awesomewm or why it would only affect new terminals occasionally.  Either way, I'm marking this as solved.

Last edited by astex (2014-08-25 21:29:15)

Offline

Board footer

Powered by FluxBB