View previous topic :: View next topic |
Author |
Message |
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Fri Jul 31, 2009 7:53 pm Post subject: Weird characters in ncurces applications in screen over ssh |
|
|
I use pork which is an AIM client on a headless box over ssh. I'm not sure if it's ssh, lack of character support on the server, or something with pork but instead of seeing a line the way it would usually be drawn in ncurces, I see ââââââââââââââââââââââââââââ. It gets pretty annoying looking at everything made out of garbage. Does anyone have any ideas where I should begin to look to diagnose this problem?
Oh and another thing, I don't have this same issue on another box, things are displayed as they should be. The emerge --info of the headless box is:
Code: | Portage 2.1.6.13 (hardened/x86, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.28-hardened-r9 i686)
=================================================================
System uname: Linux-2.6.28-hardened-r9-i686-AMD_Athlon-tm-_64_Processor_3000+-with-glibc2.1.3
Timestamp of tree: Tue, 21 Jul 2009 17:00:01 +0000
app-shells/bash: 3.2_p39
dev-lang/python: 2.5.4-r3
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox: 1.6-r2
sys-devel/autoconf: 2.13, 2.63
sys-devel/automake: 1.9.6-r2, 1.10.2
sys-devel/binutils: 2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool: 1.5.26
virtual/os-headers: 2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
sys-devel/autoconf: 2.13, 2.63
sys-devel/automake: 1.9.6-r2, 1.10.2
sys-devel/automake: 1.9.6-r2, 1.10.2
sys-devel/binutils: 2.18-r3
sys-devel/automake: 1.9.6-r2, 1.10.2
sys-devel/binutils: 2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool: 1.5.26
virtual/os-headers: 2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="apache2 berkdb cracklib crypt hardened jpeg midi nls nptl nptlonly pam pic readline ssl symlink sysfs tcpd threads unicode urandom vhosts x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY |
Last edited by PM17E5 on Tue Sep 08, 2009 2:46 am; edited 1 time in total |
|
Back to top |
|
|
wuzzerd Guru
Joined: 05 Jan 2005 Posts: 467 Location: New Mexico
|
Posted: Sat Aug 01, 2009 12:53 am Post subject: |
|
|
Try setting the value of the TERM variable in the environment of the remote connection to something compatible with your local terminal. |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Mon Sep 07, 2009 1:48 pm Post subject: |
|
|
How would I go about doing that? |
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Mon Sep 07, 2009 2:56 pm Post subject: |
|
|
I think you could set it in the .bashrc file of the remote box's user account; e.g.
Run set | grep TERM on your local box. |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Tue Sep 08, 2009 2:45 am Post subject: |
|
|
Aha, thank you for that tip, I'm starting to get somewhere.
It appears that if I run the ncurces application in plain console over ssh then everything is fine. However when I run it in screen over ssh that is when it starts to draw those weird characters instead of lines, at least in that particular application that I've tried. I tried this in a local console in screen and it drew everything fine. Also I remember it wasn't always like this on the remote machine. I checked the variable for TERM and both local and remote machine showed "xterm". However when I check that variable inside a screen session over ssh, the output is very strange:
Code: | TERM=screen
TERMCAP=$'SC|screen|VT 100/ANSI X3.64 virtual terminal:\\\n\t:DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:UP=\\E[%dA:bs:bt=\\E[Z:\\\n\t:cd=blalblahblah |
Oh, nvm it does the same on a local machine when I run it. Hmm, so what could be causing this?
My .screenrc file on both machines is:
Code: | hardstatus on
hardstatus alwayslastline
hardstatus string "%{= kB}%-Lw%{= kG}%n* %t%{= kB}%+Lw%{= kR} | %h" |
|
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Tue Sep 08, 2009 3:22 am Post subject: |
|
|
I know your remote box is headless, but are you running X sessions at both ends? And if so what kind of terminals are running?
I'm asking because your TERM=xterm. |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Tue Sep 08, 2009 3:28 am Post subject: |
|
|
Nope, I have no xorg on the headless box, but I'm using plain old xterm on my home machine. You just made me think of trying something else though, I logged in without xorg on plain console to the box and connected to the screen and everything was being displayed just fine. So the issue must be my box? Hmm.
On a gui-less machine, what should the xterm TERM value typically be? |
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Tue Sep 08, 2009 5:11 am Post subject: |
|
|
Most likely TERM=linux |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Tue Sep 08, 2009 5:21 am Post subject: |
|
|
Do you have any ideas on my most recent findings? And what I should do on my local box? |
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Tue Sep 08, 2009 12:24 pm Post subject: |
|
|
You could try a different type of terminal on your local box: rxvt-unicode for example, see how that goes. |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Tue Sep 08, 2009 2:29 pm Post subject: |
|
|
I don't like all those bloated terminals, and it didn't always used to do this. I don't get why it's doing it now. Maybe I'm missing some sort of encoding? |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Fri Sep 11, 2009 5:46 pm Post subject: |
|
|
Anyone? |
|
Back to top |
|
|
Buddie n00b
Joined: 08 Nov 2009 Posts: 1
|
Posted: Sun Nov 08, 2009 7:53 pm Post subject: |
|
|
Have you set your term in your .screenrc?
I had a similar problem a while ago and setting 'term rxvt-256color' in my .screenrc sorted it out. |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Fri Nov 27, 2009 2:25 am Post subject: |
|
|
Tried it, doesn't do a thing. |
|
Back to top |
|
|
animous n00b
Joined: 14 Oct 2006 Posts: 5
|
Posted: Thu Jul 01, 2010 8:06 pm Post subject: |
|
|
Raising this thread from the dead with a solution.. I ran into the same problem today. Using putty, running mucous (museekd ncurses client) inside a screen would print a bunch of garbage ââââââââââââââââââââââââââââ instead of lines. The display was perfect when not running from inside a screen.
After lots of googling, fiddling with TERM, .screenrc and other stuff, I stumbled upon a solution myself..
All you need to do is change ISO-8859-1 to UTF-8 in putty. Do this by going to Session settings/Window/Translation/Received data -> select UTF-8.
Hope this helps someone 'cause I know it was driving me nuts. |
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
Posted: Fri Jul 02, 2010 7:35 am Post subject: |
|
|
To get screen to display in UTF-8 you should use the -U option. _________________ Search | Read | Answer | Report | Strip |
|
Back to top |
|
|
Bapabooiee n00b
Joined: 18 Oct 2009 Posts: 25
|
Posted: Tue Jul 20, 2010 4:57 am Post subject: |
|
|
I've also been experiencing this issue; thanks for the fix.
Also, if you want Screen to use UTF-8 without having to specify the -U switch every time, just add the line "defutf8 on" into your ~/.screenrc file:
Code: | echo "defutf8 on" >> ~/.screenrc |
|
|
Back to top |
|
|
|