Terminal emulation in aptitude & emacs not right...

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
websissy
Posts: 170
Joined: 2008-07-21 01:38
Location: Socorro, NM USA

Terminal emulation in aptitude & emacs not right...

#1 Post by websissy »

Having problems with terminal emulation in both aptitude and emacs. This has been going on for a week and
perhaps since the very beginning. I've only been at this for 8 days now and I'm not sure when the
problem first appeared.

The first sign of trouble is when I look at a screen in aptitude, I see odd characters on the right side of
the page.

Image

I also see similarly weird characters in the aptitude drop-down menus...

Image

When I check my environment variables just before executing aptitude, i find TERM is set to xterm.

Code: Select all

TERM=xterm
SHELL=/bin/bash
SSH_CLIENT=71.166.21.21 3997 22
SSH_TTY=/dev/pts/1
USER=root
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;bklah... blah... blah...
p3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:
MAIL=/var/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/root
LANG=en_CA.UTF-8
PS1=\h:\w\$
SHLVL=1
HOME=/root
LS_OPTIONS=--color=auto
LOGNAME=root
SSH_CONNECTION=71.166.21.21 3997 
_=/usr/bin/env
Can anyone tell me how to determine what termtype aptitude is expecting or does it grab its termtype
from the environment variable? OR... could my whole problem here be the terminal emulation settings
in puTTY? Hmmm...

I'm having similar issues with emacs running on my server except in that case the top of window
drop-down menus are not accessible using my PC's mouse at all.

Image

(NOTE: My local machine is NOT a linux box. I AM running on a Win-XP / putty platform locally and talking
to the remote host through PUTTY.) It acts as if the putty window doesn't share the mouse activity with
linux at all. Is there a better/preferred way of accomplishing this?

I do have the windows version of emacs running on my PC. It looks the same as the linux version
does and the mouse works just fine. I'm wondering if there's something I need on either the linux/putty
side of things that will cause the keystrokes to get passed through to linux and page-draw characters
FROM linux to get handled correctly on my PC...

Any suggestions on how to find and fix the causes of these issues would be appreciated.

Thanks!

User avatar
industrialpunk
Posts: 731
Joined: 2007-03-07 22:30
Location: San Diego, CA, USA

#2 Post by industrialpunk »

It's putty configuration issues that causes the characters instead of ncurses
shapes. Here are the putty options you should use:

Terminal> Keyboard > The function keys and Keypad: Linux
Window> Translation> Recieved data assumed to be... UTF-8 (debian default)
Window> Translation > Use Unicode line drawing code points
Connection>Data> Terminal-type string: linux



Are those menus even supposed to work with a mouse in linux? I use vim and don't know much about emacs. But if its like other ncurses interfaces you activate those drop down menus with a key like F9,F10,C-T, or escape.
Last edited by industrialpunk on 2008-07-28 22:34, edited 2 times in total.
-Josh Willingham

User avatar
industrialpunk
Posts: 731
Joined: 2007-03-07 22:30
Location: San Diego, CA, USA

#3 Post by industrialpunk »

Just noticed. Look at your emacs screenshot. Read the 7th line down:
"Activate menubar F10 or ESC ` or M-`"
-Josh Willingham

User avatar
websissy
Posts: 170
Joined: 2008-07-21 01:38
Location: Socorro, NM USA

vi & vim cursor (arrow) keys, aptitude menus & emacs

#4 Post by websissy »

Partially solved the problem in Aptitude

Changed the character set translation setting on puTTY's window / translations settings page to utf8. from what it was set. In short, I set it to match the "LANG=en_CA.UTF-8" setting in the environment variables and the menu boxes and most other "line-draw" graphics in aptitude started working right. However, oddly, the line draw in the "Are You sure" popups of aptitude (like in the "Are you SURE you want to exit" pop-up) instantly stopped working! grrrrr...

I had also forgotten to report that I was having similar "terminal emulation" problems in the vi / vim editor with the arrow keys and cursor keys. The arrow keys worked fine in "normal" mode but in EDIT mode they did not move the cursor as expected and inserted extra characters instead. There were also several other helpful features that did not work correctly. For example when you hit i or a to enter insert mode and add test in a line, the usual "INSERT" message did not show up in the status line.

In investigating this problem, I found a sample vimrc file (note the missing period at the beginning of the file name name) in /etc/vim and placed it into the home directory for root with the name ".vimrc" RATHER than just "vimrc". As soon as I did that, all of the terminal emulation issues with vim disappeared.

IN testing the solution, I discovered that if I started the program as vi, the anomalies were still there; but they were GONE if I started it as vim. So I added a simple alias line to .bashrc that equated vi to vim:

alias vi='vim'

Then I saved the change and restarted my session. As soon as I did that, the problems with vim AND vi had totally vanished. Suddenly vim/vi is whole again.

Hurray! That's one small step for man, and a giant leap for debian-kind.

No luck with the emacs top of page menus yet. I'm still pondering that one.

Still looking for a similarly complete solution for aptitude and emacs. Hints, helpful suggestions and/even wiseass remarks will be considered. ;)

Step-by-step-by-step-by-inexorible-step...

User avatar
websissy
Posts: 170
Joined: 2008-07-21 01:38
Location: Socorro, NM USA

#5 Post by websissy »

industrialpunk wrote:It's putty configuration issues that causes the characters instead of ncurses
shapes. Here are the putty options you should use:

Terminal> Keyboard > The function keys and Keypad: Linux
Window> Translation> Recieved data assumed to be... UTF-8 (debian default)
Terminal> Keyboard > Use Unicode line drawing code points
Connection>Data> Terminal-type string: linux

Are those menus even supposed to work with a mouse in linux? I use vim and don't know much about emacs. But if its like other ncurses interfaces you activate those drop down menus with a key like F9,F10,C-T, or escape.
Thanks, Josh. I see you were here reporting while I was busy reporting my own test results. I took a look at your recommendations on puTTY terminal emulation settings and tried them out; but what I found was none of them seemed to improve the terminal emulation performance over the one I discovered and made which was the same UTF8 change you recommended.

Nevertheless, I took your suggestions on the keypad and function key settings and changed them to Linux I had them set to xterm which is what the environment variables shows as my selected term type.

Oddly, my version of puTTY (v0.6.0) which appears to be the latest one does NOT show EITHER the:

Terminal> Keyboard > Use Unicode line drawing code points
Connection>Data> Terminal-type string: linux

You mentioned. those options aren't on my puTTY setup screens at all.

But, Josh, YOU get the prize of the afternoon for noticing the totally obvious message I SHOULD have noticed on the Emacs startup screen. Thanks guy, that solved a BIG problem for me. I've missed the power of emacs here.

I've used the emacs editor for 28 years. It actually was my FIRST PC editor under CPM where it was provided as "Perfect Writer" on my first Kaypro 2 back in 1980. Later I bought it again as Final Word from a company called "Mark of the Unicorn". Still Later, I bought it again as Borland's Sprint. After that, it seemed to vanish from the PC/Windows arena completely. But I continue to prefer it when dealing with large text files.

Thanks a BUNCH for the tips, Josh! I'll be glad to send you the rubber chicken that was to be my grand prize for solving the emacs problem. 8)

User avatar
industrialpunk
Posts: 731
Joined: 2007-03-07 22:30
Location: San Diego, CA, USA

#6 Post by industrialpunk »

One typo and one explanation.
The unicode setting is under Window >Translation not keyboard.
The terminal type string is a text field with the default "xterm." You have to replace this with "linux"

I'm using v0.60 as well.
-Josh Willingham

User avatar
websissy
Posts: 170
Joined: 2008-07-21 01:38
Location: Socorro, NM USA

#7 Post by websissy »

industrialpunk wrote:One typo and one explanation.
The unicode setting is under Window >Translation not keyboard.
The terminal type string is a text field with the default "xterm." You have to replace this with "linux"

I'm using v0.60 as well.
Okay. I found the Unicode setting on the translation screen. It was already set to "Use Unicode line drawing points"

I still do not find ANY data setting for the Connection page. In my copy of putty, there's nothing ON that Connection page at all other than "Seconds between keep alives". Below that is the SSH connection settings and as you would expect, those pages never mention a "terminal type" at all. I've looked on the other pages for a "terminal type" setting that's text and can't find one. :(

I wonder why that setting doesn't show up on my copy of putty?

User avatar
Ook
Posts: 907
Joined: 2006-11-28 05:49

#8 Post by Ook »

websissy wrote:
industrialpunk wrote:One typo and one explanation.
The unicode setting is under Window >Translation not keyboard.
The terminal type string is a text field with the default "xterm." You have to replace this with "linux"

I'm using v0.60 as well.
Okay. I found the Unicode setting on the translation screen. It was already set to "Use Unicode line drawing points"

I still do not find ANY data setting for the Connection page. In my copy of putty, there's nothing ON that Connection page at all other than "Seconds between keep alives". Below that is the SSH connection settings and as you would expect, those pages never mention a "terminal type" at all. I've looked on the other pages for a "terminal type" setting that's text and can't find one. :(

I wonder why that setting doesn't show up on my copy of putty?
You have Putty 6.0 for XP and the Connection dialog does not have Data, Proxy, Telent and Rlogin child dialogs preceding the SSH child dialog? :?

In my version of Putty 6.0 for XP the Terminal-type-string window is in the Data child dialog, the first dialog nested in Connection. In my Putty 5.6 for XP, it is as industrialpunk describes.

You might try downloading and installing again.

http://tartarus.org/~simon/putty-snapsh ... taller.exe

User avatar
industrialpunk
Posts: 731
Joined: 2007-03-07 22:30
Location: San Diego, CA, USA

#9 Post by industrialpunk »

Ah, I think you are trying to change the settings while you have the session open. Not all the settings will be available to change once you have the session open. Make sure you check the configuration before.
-Josh Willingham

User avatar
websissy
Posts: 170
Joined: 2008-07-21 01:38
Location: Socorro, NM USA

#10 Post by websissy »

Yikes! Are we even talking about the same program here?

I did NOT say I'm running PuTTY v6.0, Ook. I said I'm running PuTTY v0.6.0! It's version "point 6"and not version 6... and it's written by Simon Tatham and was released on 04/29/2007.

I grabbed a fresh download from the site you suggested and did some testing. It turns out I'm running exactly the same version YOU and IndustiralPunk are, Ook.

It's just that once you get a successful connection with SSH all those other settings for Data, Proxy, Telnet, Rlogin and Serial under the "Connection" submenu and several other settings on the Session screen as well VANISH from the settings menu ENTIRELY. You basically don't need them after you make an SSH connection.

You may recall from earlier posts that all my connections with root are actually secure ssh connections. Once you've established that sort of connection all the options for RAW and Telnet and Rlogin and Serial and Data and Proxy etc. make no sense in the menus. That's why I don't see them.

They ARE there in the menus when I first bring up PuTTY. But the moment I choose the stored SSH session settings for my new server, they instantly disappear.

Stop worrying. I'm not running a virus eaten copy of PuTTY. The same exact thing happened when I grabbed a fresh copy from the site you suggested and configured it the same way my local copy was configured! :)

Stop frettin' about the "gramps", here Ook. I'm doin' fine for an old guy. And with Josh's help, it looks like I got most of my terminal emulation issues fixed today. Thanks, Josh!

The only one I KNOW of that's left is the one that involves the character set being used to display pages in Apache. I'll tackle that one later this week.

Hmmm, this post get's me to thinkin' though, maybe I oughta change my name from "websissy" to "gramps", or "oldfart", or "2000YOMan", or "olderthandirt". Whaddya think, Ook? After 40 years of hard labor in the technology salt mines and still slaving away here, have I earned the title OlderThanDirt yet? ;)

Thanks, Josh. You too Ook... See you round the old geeks' home!

just sign me...
OlderThanDirt

User avatar
Ook
Posts: 907
Joined: 2006-11-28 05:49

#11 Post by Ook »

It is me again. I am going to have to slow down. (I have a real job:)) Version .6

So the putty settings process, like industrialpunk says:

Select a "saved session"

hit "load"

edit settings to tast

hit "save"

Then you can "open" session and those settings should be working for you.

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

#12 Post by Issyer »

In console favor of emacs mouse doesn't work. Only keyboard. I knew how to access the help menue but I forgot. Google yourself.

Post Reply