Solved

'backspace' differs between sun machine and windows with exceed

Posted on 2002-07-01
9
1,264 Views
Last Modified: 2008-02-01
I work with a Sun workstation and a Windows PC.

Largely for cut and paste reasons and not having to remember which keyboard I'm supposed to use - I use exceed on my PC to work on the unix machine.

Strangely, the 'backspace' key behaves differently between the two environments, however.

My shell is tcsh.  'edit' is set.

On the actual Sun machine, 'backspace' works as a "backward-delete-char", which seems to be like ^h

Via Exceed, 'backspace' works as a "delete-char-or-list-or-eof", which seems to be like ^d.

There seem to be a lot of ways to map keys in unix:
- set/unset 'edit'
- use bindkey
- stty

There's ^h and ^d type characters; then there's "backward-delete-char" and "delete-char-or-list-or-eof", etc.

I don't understand how they all connect together and where the backspace key is getting messed up.

For xterm, I can set a macro in exceed that does a "^h" character, but that doesn't work for other things like emacs, which doesn't interpret ctrl-h as "backward-delete-char".

Please help me understand this!!
0
Comment
Question by:red5
9 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7124038
depends on many things, unfortunately.
  - stty
  - /etc/termcap (or termlib)
  - used shell (check with: echo $SHELL)
  - used terminal (check with: echo $TERM)
  - used terminal window (hard to check: echo $TERM #usually)

in most cases either of following commands should do what you want:
   stty erase '^?' ; reset
   stty erase '^H' ; reset
Sometimes you need to redefine the TERM environment variable to a proper value. xterm is a good one on Solaris (except you are using Solaris' proprietary cmdtool). If all fails, try to set TERM to vt100.

emacs and vi are very picky on the TERM variable, 'cause they both use it to get the appropriate information from /etc/termcap. emacs have some more dragons to beat, 'cause it can redefine allmost anything when it is started.
0
 

Author Comment

by:red5
ID: 7124833
hmm, I tried the stty commands and changing the TERM to vt100; no luck.  Here's some output before any of those changes:

/home/red5 > stty
speed 9600 baud; evenp hupcl
rows = 70; columns = 108; ypixels = 914; xpixels = 667;
erase = ^h; kill = ^c; swtch = <undef>; werase = ^d;
brkint -inpck icrnl -ixany onlcr
echo echoe echok echoctl echoke iexten
/home/red5 > echo $SHELL
/bin/tcsh
/home/red5 > echo $TERM
xterm


I'm wondering if exceed is changing the key mapping so that the sun machine sees 'backspace' as a different key depending on whether it comes from its local keyboard or via exceed.

Is there some program I can write to display a key code or something?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7125442
> .. wondering if exceed is changing the key mapping
YES IT DOES. unfortnately, luckily
Try to switch of the Backspace/Delte features in exceed.

> display a key code or something?
some X Server come with a program called xkeycaps ...
0
 
LVL 3

Expert Comment

by:gandalf94305
ID: 7163594
I have two aliases: ^H setting stty erase to control-h (backspace) and ^? setting stty erase to delete. Whenever I notice something is not working properly, I can quickly switch.

--g.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:red5
ID: 7165254
I still don't understand exactly how it everything plugs together.

Using 'stty' to, for example, set erase = ^H, suggests that this is a translation.  But which is being translated to which?

Does the xterm receive some kind of "erase" and it translates it to "^H" or the other way around?

And what about things like "delete-char-or-list-or-eof"?  Where does this come in.

There must be a traceable sequence; like, when a key is pressed, it goes to ThingA with a TypeA and because ThingB is set to whatever, the key gets translated to TypeB, and so on...
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7165313
> There must be a traceable sequence;
For shure: there are at least 3 such tables !!
   1. hardware driver
   2. OS
   3. application (X-server)
   4. application (xterm)
   5. application (shell)
   6. application (vi)
all of these tables may be modified with approriate commands (stty, xmodmap, loadkey), it also depends where your are: local or remote X-Server.
In your case there might be:
   2a. Exceed
If you want to know/learn all the details, you need to read lot of docs, and do some try&error. Best you start at a plaine text console (no X involved) to get the basics.
The most complex parts are the tables in the X-Server.
0
 

Author Comment

by:red5
ID: 7269660
Well, I haven't really learned much new about keycodes in the world of unix, but I have figured out my problem.

In the Exceed keyboard mapping, the Unshifted Backspace key was mapped to 'BackSpace' and the Shifted Backspace key was mapped to 'Delete'.  Now, I wasn't using Shift with Backspace, but it turns out if I clear the mapping for the Shifted backspace key, then backspace behaves properly.

Weird.  Some kind of Exceed bug, maybe.  I know that 'Shifted' means what I think it means, becuase (as a test) I mapped the Shifted backspace key to 'X' and the result was that backspace alone performed backspace, and Shift+BackSpace performed 'X'.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 7921518
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- PAQ & refund points

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7967174
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now