Results 1 to 7 of 7
  1. #1

    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    Delete Key Doesn't Work in xterm - How to Fix It?
    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

  2. #2

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    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
    Cool
    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!

  3. #3

    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    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

  4. #4

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    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
    Cool
    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!

  5. #5

    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    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

  6. #6

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    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
    Cool
    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!

  7. #7

    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power key often doesn't work
    By paultilling in forum Apple Desktops
    Replies: 5
    Last Post: 11-11-2014, 06:36 PM
  2. Key doesn't work/Buying keyboard
    By cubby in forum Apple Notebooks
    Replies: 6
    Last Post: 05-28-2009, 11:21 PM
  3. Option key on startup doesn't work
    By mac3 in forum OS X - Operating System
    Replies: 6
    Last Post: 03-15-2009, 02:36 AM
  4. Option/Alt key+C Doesn't work anymore...
    By Aporu in forum OS X - Operating System
    Replies: 7
    Last Post: 09-17-2007, 08:56 AM
  5. My Delete Key Won't Work
    By jimmyboi1 in forum Apple Notebooks
    Replies: 1
    Last Post: 08-01-2007, 11:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •