Thread: Why some linux shell doesn't support "Delete" Key?

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    284

    Why some linux shell doesn't support "Delete" Key?

    I know this is a little off-topic, but I can't find another forum to post it.

    When I press "Delete" Key in a command line of bash, it just shows a ~. What's wrong?
    I tried to use
    Code:
    stty erase '^?'
    But it still won't work.
    Thanks for helping me.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    There is a Linux forum, so perhaps one fo the fine moderating team can move the post to the appropriate place.

    My guess would be that your terminal settings and what your keyboard (driver) is sending do not match up. But without being at your machine to see what happens when you do certain things, I can't quite say. I'm usually using Emacs commands for editing in Bash anyways, so I don't tend to use delete often.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Or perhaps even the tech board since this is not a question pertaining to linux programming. What OS are you using? What version of bash on that OS?

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    284
    The OS is Linux debian.

    Code:
    >bash --version
    GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
    Copyright (C) 2002 Free Software Foundation, Inc.
    Code:
     >stty
     speed 38400 baud; line = 0; 
     eol = M-^?; eol2 = M-^?;
     -brkint ixany


    Thanks for your kind help.

    Quote Originally Posted by master5001 View Post
    Or perhaps even the tech board since this is not a question pertaining to linux programming. What OS are you using? What version of bash on that OS?

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I am thinking matsp's driver hypothesis sounds the most likely. Perhaps you can double check to make sure your keyboard is being detected properly. I imagine your delete key works fine in x, right?

  6. #6
    Registered User
    Join Date
    Apr 2007
    Posts
    284
    Yes. my Delete is fine.
    BTW, the problematic machine is a Linux server that I connect to by ssh.

    Quote Originally Posted by master5001 View Post
    I am thinking matsp's driver hypothesis sounds the most likely. Perhaps you can double check to make sure your keyboard is being detected properly. I imagine your delete key works fine in x, right?

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Oh? So obviously the best solution is to type without making mistakes (LOL! I have to laugh at the irony behind the typing of that sentense. I am normally a very accurate typer--rather I type exactly what I mean too; which doesn't necessarily guarantee what I was intending to type was spelled correctly--and I typoed nearly every single word on that line)

  8. #8
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I am googling around for more info...

    hmmm.

    Are you telnetting from a windows box? Actually, that link should help you regardless of your configuration on your machine and the configuration of the target machine.
    Last edited by master5001; 09-24-2008 at 07:24 PM.

  9. #9
    Registered User
    Join Date
    Apr 2007
    Posts
    284
    Thanks. I keep refreshing this thread to get the answer.
    No I ssh from a linux box as well. In this one it works.

    Quote Originally Posted by master5001 View Post
    I am googling around for more info...

    hmmm.

    Are you telnetting from a windows box?

  10. #10
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Just check out the bottom of that page. This thread will likely get moved to the linux or tech board as soon as laserlight or Salem happens by. And if you have posted this question anywhere else on the web, Salem will hunt it down (that is his mission in life).

  11. #11
    Registered User
    Join Date
    Apr 2007
    Posts
    284
    Got it. It seems that this post does not apply to my case.
    When I press down "Delete" Key, the screen shows ~ rather than ^H or ^?
    I tried
    Code:
    stty erase ~
    or
    Code:
    stty erase ^?
    Neither work, i.e. when I press Delete key again, it does not function correctly.

    Quote Originally Posted by master5001 View Post
    Just check out the bottom of that page. This thread will likely get moved to the linux or tech board as soon as laserlight or Salem happens by. And if you have posted this question anywhere else on the web, Salem will hunt it down (that is his mission in life).

  12. #12
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Does your backspace work correctly at least? Let me see if there is some other magic to be worked.

  13. #13
    Registered User
    Join Date
    Apr 2007
    Posts
    284
    Yes, my backspace works correctly.

    Quote Originally Posted by master5001 View Post
    Does your backspace work correctly at least? Let me see if there is some other magic to be worked.

  14. #14
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    It seems to me you should have been putting

    Code:
    stty erase '~'
    But that is ok. Try doing an stty sane to default everything.

  15. #15
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    431
    I think it might be a problem with SSH.
    I just tried ssh'ing from my XP machine to a Solaris server and I get the same thing.
    I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. "press any key to continue" without the enter key
    By chickenandfries in forum C Programming
    Replies: 1
    Last Post: 03-29-2008, 09:56 PM
  2. Dev-cpp - compiler options
    By tretton in forum C Programming
    Replies: 7
    Last Post: 01-06-2006, 06:20 PM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. Does linux support
    By incognito in forum C++ Programming
    Replies: 1
    Last Post: 12-03-2001, 11:28 PM