New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Delete Key Doesn't Work in xterm - How to Fix It?


Post Reply New Thread Subscribe

 
Thread Tools
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
I am running Apple's X11. From within an xterm, when I press the Delete key, I get a nasty key code that xterm doesn't recognize as delete. I would like to remap that so that it works as intended. As an example, this would remap the Backspace key:

xmodmap -e "keycode 59 = BackSpace"

What is the magic keycode and word for Delete? Something along the lines of:

xmodmap -e "keycode xy = Delete" ?

In this case, what is the value of "xy", and is "Delete" the correct keyword?

Thanks!

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,589
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
If the delete key functions the same way as the backspace key. Then this is what I do at the command line.

stty erase deletekey

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
Nope, that didn't do it! I opened an xterm and tried this, but I still get junk when I press the delete key.

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,589
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
You did press the delete key, in place of the word deletekey and not type deletekey. I should have made it more clear.

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
Well not exactly rman. In the "right out of the box" configuration (Apple's X11 as it came, I haven't mod'd Xresources, Xmodmap, etc.), when I press the Delete key I get some form of escape sequence that puts a few characters of jibberish in the screen. Starting from there, if I type "stty erase <press Delete key>" and try using the Delete key (desired behaviour is that it deletes the key under the cursor, not the one to the left of the cursor, like Backspace does) I still get jibberish.

I did eventually modify this such that the Delete key at least behaved like Backspace (trying out a suggestion I found on Google) by adding

xterm*.deleteIsDEL: true

to a .Xresources file. If I now restart Apple X11, the Delete key works like the Backspace key.

If I now follow your prescription above, pressing the Delete key where you say "deletekey" simply backspaces! I tried doing it "literally" (ctl-v, then Delete), the Delete kill still behaves like Backspace.

I have also tried "stty kill <press Delete key>" to no good end.

This is pretty frustrating. I have a perfectly good Delete key that will only Backspace. I am sure that some magic combination of Xresources, xmodmaps and sttys will do the job, but I am stuck for the prescription!

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,589
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
interesting, I would have to look farer. I have never used the delete key. Except for control-alt-del of course.

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks
mac57

 
mac57's Avatar
 
Member Since: Apr 29, 2006
Location: St. Somewhere
Posts: 4,560
mac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant futuremac57 has a brilliant future
Mac Specs: iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM

mac57 is offline
Solved it! Finally, here is how to make your Delete key act like a real Delete key, which is to say that it deletes the character currently under the cursor rather than doing a Rubout (delete the character to the left of the cursor) or worse still, insert a "~" into the line.

This solution is specific to the bash shell, and works for bash under both Apple's X11 xterm and Terminal.app (bash is the default shell in both cases).

Create a file in your home directory called .inputrc - Put the following single line into that file:

"\e[3~": delete-char

Restart Terminal.app or create a new xterm if using X11. Thats it! I have tested it and it works like champ. bash apparently reads this file every time it starts.

You can read LOTS more about this problem and related problems by Googling the phrase "bash delete key". Apparently this is a VERY common issue.

My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
I was on the Mac-Forums honor roll for September 2007
QUOTE Thanks

Post Reply New Thread Subscribe


« XCode environment | Closing Terminal.app Window When App Exits »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Why won't my animated gifs work on Macs? Kalitechnis Web Design and Hosting 21 05-07-2008 10:18 AM
Delete key not emulating right in ssh'd terminal n0r1 OS X - Apps and Games 2 03-13-2005 07:55 PM
Upgrade to 10.3.8/Eject Button Doesnt Work Fix MactotheMax OS X - Operating System 0 02-18-2005 02:58 PM
end key? jcart OS X - Operating System 0 01-08-2005 12:31 PM
space key does not work plutonito Other Hardware and Peripherals 7 09-15-2004 04:57 PM

All times are GMT -4. The time now is 05:58 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?