How to make "delete" key work on current character? - SCO

This is a discussion on How to make "delete" key work on current character? - SCO ; Hello. In OpenServer 5.0.7, I've already configured "stty intr ^C erase ^?" as I'm more used to that. However, I have a key still not to my liking: the "Delete" key (it says "Delete" on the keyboard). Currently, it does ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: How to make "delete" key work on current character?

  1. How to make "delete" key work on current character?

    Hello.

    In OpenServer 5.0.7, I've already configured "stty intr ^C erase ^?" as
    I'm more used to that.

    However, I have a key still not to my liking: the "Delete" key (it says
    "Delete" on the keyboard). Currently, it does a "deletion of the
    character to the left of the cursor" (also known as "backspace" or
    "rubout", I think). I would like it to do a "deletion of the character
    above cursor", as it usually does in MS-DOS, Windows and Linux.

    When in Linux/Bash console, if I press "Ctrl-V", then "Delete", the
    escape sequence that gets printed is "^[[3~" (without the quotation
    marks). When in OSR507 at the console, also running Bash (installed by
    default from MP5), if I press "Ctrl-V", then "Delete", it gets printed
    "^?" (without the quotes). So I guess I need to know how do I shoehorn
    "^[[3~" instead of "^?" intro the "Delete" key.

    Is that right? How is it done?

    I have been reading mapkey(M), mapstr(M), tset(C), but I couldn't find
    my way around to the answer.

    (Coincidentally, in "/usr/lib/keyboard/strings" many control keys are
    listed and defined, but the "Delete" key is missing; there is a "Shift
    Delete", "Ctrl Delete" and "Alt Delete", but no "Delete" by itself. Is
    it a reserved key in OSR5 or something?)

  2. Re: How to make "delete" key work on current character?


    ----- Original Message -----
    From: "Pepe"
    Newsgroups: comp.unix.sco.misc
    To:
    Sent: Sunday, July 15, 2007 12:03 PM
    Subject: How to make "delete" key work on current character?


    > Hello.
    >
    > In OpenServer 5.0.7, I've already configured "stty intr ^C erase ^?" as
    > I'm more used to that.
    >
    > However, I have a key still not to my liking: the "Delete" key (it says
    > "Delete" on the keyboard). Currently, it does a "deletion of the character
    > to the left of the cursor" (also known as "backspace" or "rubout", I
    > think). I would like it to do a "deletion of the character above cursor",
    > as it usually does in MS-DOS, Windows and Linux.
    >
    > When in Linux/Bash console, if I press "Ctrl-V", then "Delete", the escape
    > sequence that gets printed is "^[[3~" (without the quotation marks). When
    > in OSR507 at the console, also running Bash (installed by default from
    > MP5), if I press "Ctrl-V", then "Delete", it gets printed "^?" (without
    > the quotes). So I guess I need to know how do I shoehorn "^[[3~" instead
    > of "^?" intro the "Delete" key.
    >
    > Is that right? How is it done?
    >
    > I have been reading mapkey(M), mapstr(M), tset(C), but I couldn't find my
    > way around to the answer.
    >
    > (Coincidentally, in "/usr/lib/keyboard/strings" many control keys are
    > listed and defined, but the "Delete" key is missing; there is a "Shift
    > Delete", "Ctrl Delete" and "Alt Delete", but no "Delete" by itself. Is it
    > a reserved key in OSR5 or something?)


    It's not smart to change what the console actually does. That basically
    breaks termcap/terminfo, and any number of assumptions throughout various
    apps that think they know what an "ansi" terminal is. (really sco's version
    of ansi, but TERM just says ansi).

    Rather, when telnetting from linux, ensure that there is an accurate
    definition for your terminal in termcap and terminfo on the sco box. That
    most likely means copying at least the definitions for linux and the
    xfree86/xorg xterm-color from linux's termcap & terminfo and installing on
    sco. Thats impractical unless you just have a one or a few regular sco
    boxes. If you need to connect to many random sco boxes as a consultant or
    programmer etc.. then it's silly to do anything but use a terminal emulator
    that has a sco-ansi mode.

    Then when telnetting from linux to sco, TERM will be set to "linux" or
    "xterm-color". If xetrm, you have to go out of your way to change you xterm
    on linux to set TERM to xterm-color instead of just xterm, because as I
    mentioned before, there already is an xterm definition on sco that you don't
    want to overwrite or replace, and which does not accurately define the xterm
    from linux. It's simpler to just ensure that from linux, if in X, make sure
    you use the linux console mode available in both kde terminal and gnome
    terminal. That way you just have to define "linux" on sco.

    Assuming you do that, then on sco, TERM will be "linux" and programs
    (including the shell) on sco will consult termcap & terminfo to find out how
    to talk to and interpret a linux terminal, and if you are telnetting from
    the linux console or gnome-terminal in linux mode, then your terminal will
    in fact be a linux terminal, and so everything will work.

    Except for a few special cases, it doesn't really matter what bytes a
    particular key sends, merely that the host knows how to interpret it.
    The linux termcap & terminfo definitions both say that the delete character
    key is ^[[3~, and a linux terminal does send that, so all thats required is
    for you to be correctly telling the host that you are using a linux terminal
    (by setting TERM=linux) and for there to be a good definition of linux in
    the remote hosts termcap and terminfo.

    The Delete key is one of those special cases, but not in this case. If that
    isn't too confusing.
    Whatever key you want to use as the break key must be a key that generates
    only a single byte. You can't have a multi-byte escape sequence for break.
    Ctrl-C which linux and most others use is a single byte.
    On sco the default break key is Delete, which, on sco-ansi terminals is also
    a single byte, Ctrl-?.
    On linux terminals, the Delete key sends an escape sequence so normally, the
    Delete key couldn't be used for the break key (stty intr ...) on linux
    terminals. But if I get you right, you do not want to use Delete for break.


    If you install the linux terminal definitions on sco, then telnet from linux
    to sco via the linux console or a gnome-terminal in linux mode, then on the
    sco box TERM should naturally wind up getting set to "linux" by itself. if
    not, manually set it. Then, when you press Delete, the sco box will know how
    to interpret the sequence and will do what the termcap/terminfo says, which
    will be delete-character.

    Copying the linux terminal definitions from linux to sco basically means:
    termcap:
    Extract the linux staza, and any required partial definition includes
    (tc=..."), from /etc/termcap on linux out to a new file linux.tc, ftp
    linux.tc to sco, append the file to the end of /etc/termcap. cat linux.tc
    >>/etc/termcap. It's only that simple because on 5.0.7 I happen to know

    there is not already any linux definition in termcap.

    terminfo:
    On linux install curses-devel package to get the infocmp utility if you
    don't already have it.
    then, while TERM=linux, run infocmp >linux.ti
    ftp linux.ti to sco, on sco run "tic linux.ti"

    Those you only have to do once.

    Then you want to also run "stty intr ^c erase ^?" at every login, which will
    clear up one more glitch.
    The linux terminal sends "^?" when you press the backspace key, which a
    sco-ansi terminal sends from the Delete key. Even with a correct termcap &
    terminfo in place, you still need to use stty to tell the sco box not to
    treat ^? as the break character and to tell it TO use ^? as the erase
    (backspace) character and to tell it to use ^c as the break character. The
    stty command generally should be put in /etc/profile or your own .profile in
    a case statement based on TERM

    case "$TERM" in
    linux) stty intr '^c' erase '^?' ;;
    esac

    The confusing backspace/delete/break issue between linux & sco is an
    extremely frequently asked question for many years. Articles about it abound
    (google).
    Basically, if you know how terminals work then there is and never has been
    any problem.
    It's only confusing if you don't know what the definition of "terminal" is,
    and the basic interaction between terminal, remote host, the TERM variable,
    /etc/termcap, the terminfo database, and applictions.
    Read up a little on that and get the basic picture, and you'll see there is
    no problem telnetting back & forth from any terminal to any host from any OS
    to any other OS. Merely some combinations need a slightly annoying amount of
    setup before they work. And when there is some glitch, you'll know both
    what's causing it and how to correct it. This is important because, you have
    not said for instance just what terminal you are using on linux to telnet to
    sco. Without knowing that, it's impossible for anyone else to tell you how
    to make things like your delete key behave in some way that you want. The
    answer is (or could be) different for the linux console vs an xterm.

    Barring learning for yourself how terminals work, then the only practical
    way to fly is to just use terminal emulators which removes all effort. You
    use an emulator in linux mode when telnetting to linux, and in scoansi mode
    when telnetting to sco, and everything "just works". In fact, even when you
    know everything, terminal emulators are still the most practical since it's
    even easier to not have problems than to know how to handle them.

    Brian K. White brian@aljex.com http://www.myspace.com/KEYofR
    +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
    filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!


  3. Re: How to make "delete" key work on current character?

    Brian K. White wrote:
    > From: "Pepe"
    >> In OpenServer 5.0.7, I've already configured "stty intr ^C erase ^?" as
    >> I'm more used to that.
    >>
    >> However, I have a key still not to my liking: the "Delete" key (it says
    >> "Delete" on the keyboard). Currently, it does a "deletion of the character
    >> to the left of the cursor" (also known as "backspace" or "rubout", I
    >> think). I would like it to do a "deletion of the character above cursor",
    >> as it usually does in MS-DOS, Windows and Linux.
    >>
    >> When in Linux/Bash console, if I press "Ctrl-V", then "Delete", the escape
    >> sequence that gets printed is "^[[3~" (without the quotation marks). When
    >> in OSR507 at the console, also running Bash (installed by default from
    >> MP5), if I press "Ctrl-V", then "Delete", it gets printed "^?" (without
    >> the quotes). So I guess I need to know how do I shoehorn "^[[3~" instead
    >> of "^?" intro the "Delete" key.
    >>
    >> Is that right? How is it done?
    >>
    >> I have been reading mapkey(M), mapstr(M), tset(C), but I couldn't find my
    >> way around to the answer.
    >>
    >> (Coincidentally, in "/usr/lib/keyboard/strings" many control keys are
    >> listed and defined, but the "Delete" key is missing; there is a "Shift
    >> Delete", "Ctrl Delete" and "Alt Delete", but no "Delete" by itself. Is it
    >> a reserved key in OSR5 or something?)

    >
    > It's not smart to change what the console actually does. That basically
    > breaks termcap/terminfo, and any number of assumptions throughout various
    > apps that think they know what an "ansi" terminal is. (really sco's version
    > of ansi, but TERM just says ansi).


    Thanks for your reply. It is not in the telnet/xterm situation, but in
    the physical text-mode console/keyboard of my SCO OpenServer 5.0.7
    system that I want the "Delete" key to produce "^[[3~".

    When at the OSR507 physical console, I want the operating system to bind
    "^[[3~" to the scan code for the "Delete" key, instead of the
    factory-default binding of "^?".

    I think the scan-code for the "Delete" key is 83 (although I'm not
    sure). So I would like to remap the physical scan code for the key
    "Delete" in the console keyboard to be assigned "^[[3~" by OSR5, as is
    typical in other systems, mainly Linux.

    When at the OSR507 console, the TERM type I have configured is
    "ansi-850". I guess then I need either to edit that definition, or to
    simply remap the key "Delete" with a command unknown to me (something
    similar to what "xmodmap" does for X).

    However, I didn't find out how to do it. As I said,
    "/usr/lib/keyboard/strings" omits the "Delete" key...

    Also, my physical keyboard is mapped to "ps.850.spa", and
    "/usr/lib/keyboard/keys" is probably the map file to modify, but I don't
    know exactly how to shoehorn "^[[3~" for scan code 83 in it...

    Regards,

    Pepe.

  4. Re: How to make "delete" key work on current character?

    Pepe wrote:

    > Brian K. White wrote:
    > > From: "Pepe"
    > >> In OpenServer 5.0.7, I've already configured "stty intr ^C erase ^?" as
    > >> I'm more used to that.
    > >>
    > >> However, I have a key still not to my liking: the "Delete" key (it says
    > >> "Delete" on the keyboard). Currently, it does a "deletion of the character
    > >> to the left of the cursor" (also known as "backspace" or "rubout", I
    > >> think). I would like it to do a "deletion of the character above cursor",
    > >> as it usually does in MS-DOS, Windows and Linux.
    > >>
    > >> When in Linux/Bash console, if I press "Ctrl-V", then "Delete", the escape
    > >> sequence that gets printed is "^[[3~" (without the quotation marks). When
    > >> in OSR507 at the console, also running Bash (installed by default from
    > >> MP5), if I press "Ctrl-V", then "Delete", it gets printed "^?" (without
    > >> the quotes). So I guess I need to know how do I shoehorn "^[[3~" instead
    > >> of "^?" intro the "Delete" key.
    > >>
    > >> Is that right? How is it done?
    > >>
    > >> I have been reading mapkey(M), mapstr(M), tset(C), but I couldn't find my
    > >> way around to the answer.
    > >>
    > >> (Coincidentally, in "/usr/lib/keyboard/strings" many control keys are
    > >> listed and defined, but the "Delete" key is missing; there is a "Shift
    > >> Delete", "Ctrl Delete" and "Alt Delete", but no "Delete" by itself. Is it
    > >> a reserved key in OSR5 or something?)

    > >
    > > It's not smart to change what the console actually does. That basically
    > > breaks termcap/terminfo, and any number of assumptions throughout various
    > > apps that think they know what an "ansi" terminal is. (really sco's version
    > > of ansi, but TERM just says ansi).

    >
    > Thanks for your reply. It is not in the telnet/xterm situation, but in
    > the physical text-mode console/keyboard of my SCO OpenServer 5.0.7
    > system that I want the "Delete" key to produce "^[[3~".
    >
    > When at the OSR507 physical console, I want the operating system to bind
    > "^[[3~" to the scan code for the "Delete" key, instead of the
    > factory-default binding of "^?".
    >
    > I think the scan-code for the "Delete" key is 83 (although I'm not
    > sure). So I would like to remap the physical scan code for the key
    > "Delete" in the console keyboard to be assigned "^[[3~" by OSR5, as is
    > typical in other systems, mainly Linux.
    >
    > When at the OSR507 console, the TERM type I have configured is
    > "ansi-850". I guess then I need either to edit that definition, or to
    > simply remap the key "Delete" with a command unknown to me (something
    > similar to what "xmodmap" does for X).
    >
    > However, I didn't find out how to do it. As I said,
    > "/usr/lib/keyboard/strings" omits the "Delete" key...
    >
    > Also, my physical keyboard is mapped to "ps.850.spa", and
    > "/usr/lib/keyboard/keys" is probably the map file to modify, but I don't
    > know exactly how to shoehorn "^[[3~" for scan code 83 in it...


    Brian's explanation contains the bits you need for success, but in my
    opinion you are going about this wrong and Brian's specific advice
    (after his correct general purpose advice) only helps you continue to go
    about it wrong.

    Your OSR5 system will be happiest if the DEL key sends the ASCII DEL
    character (0x7F, displayed as "^?" by OSR5 `stty` command). Instead of
    fighting that, you should allow it to send what it normally sends.

    Your stated reason for changing it is that you want the DEL key to do
    something different from the BackSpace key. There is a standard,
    traditional way to do that: have the BackSpace key send the ASCII
    BackSpace sequence (0x08, ^H).

    The terminal emulator you are using to connect to the OSR5 box will have
    a setting for that.

    Once your terminal is sending ^H for BackSpace, you want:

    stty intr ^C erase ^H

    (which you can probably abbreviate to just "stty intr ^C" since ^H is
    the default erase key).

    Then, depending of course on the application you are running, ^H will
    erase-left and DEL will erase-right. DEL currently does erase-left
    because you told it to, with your stty settings.

    Notice that if you continued on your current path, DEL would start
    sending ESC[3~, but no application on OSR5 would be expecting that
    sequence, so they would just do something weird. Then you would have to
    start editing the native SCO "ansi" terminal definitions to tell it that
    ESC[3~ means "user hit a key labeled DEL". This would lead to a cascade
    of further pain that you might eventually completely resolve, or which
    might continue to cause small oddities forever.

    >Bela<


  5. Re: How to make "delete" key work on current character?

    "Bela Lubkin" escribió en el mensaje
    news:200707160125.aa13439@deepthought.armory.com.. .
    > Pepe wrote:
    >
    >> Brian K. White wrote:
    >> > From: "Pepe"
    >> >> In OpenServer 5.0.7, I've already configured "stty intr ^C erase ^?"
    >> >> as
    >> >> I'm more used to that.
    >> >>
    >> >> However, I have a key still not to my liking: the "Delete" key (it
    >> >> says
    >> >> "Delete" on the keyboard). Currently, it does a "deletion of the
    >> >> character
    >> >> to the left of the cursor" (also known as "backspace" or "rubout", I
    >> >> think). I would like it to do a "deletion of the character above
    >> >> cursor",
    >> >> as it usually does in MS-DOS, Windows and Linux.
    >> >>
    >> >> When in Linux/Bash console, if I press "Ctrl-V", then "Delete", the
    >> >> escape
    >> >> sequence that gets printed is "^[[3~" (without the quotation marks).
    >> >> When
    >> >> in OSR507 at the console, also running Bash (installed by default from
    >> >> MP5), if I press "Ctrl-V", then "Delete", it gets printed "^?"
    >> >> (without
    >> >> the quotes). So I guess I need to know how do I shoehorn "^[[3~"
    >> >> instead
    >> >> of "^?" intro the "Delete" key.
    >> >>
    >> >> Is that right? How is it done?
    >> >>
    >> >> I have been reading mapkey(M), mapstr(M), tset(C), but I couldn't find
    >> >> my
    >> >> way around to the answer.
    >> >>
    >> >> (Coincidentally, in "/usr/lib/keyboard/strings" many control keys are
    >> >> listed and defined, but the "Delete" key is missing; there is a "Shift
    >> >> Delete", "Ctrl Delete" and "Alt Delete", but no "Delete" by itself. Is
    >> >> it
    >> >> a reserved key in OSR5 or something?)
    >> >
    >> > It's not smart to change what the console actually does. That basically
    >> > breaks termcap/terminfo, and any number of assumptions throughout
    >> > various
    >> > apps that think they know what an "ansi" terminal is. (really sco's
    >> > version
    >> > of ansi, but TERM just says ansi).

    >>
    >> Thanks for your reply. It is not in the telnet/xterm situation, but in
    >> the physical text-mode console/keyboard of my SCO OpenServer 5.0.7
    >> system that I want the "Delete" key to produce "^[[3~".
    >>
    >> When at the OSR507 physical console, I want the operating system to bind
    >> "^[[3~" to the scan code for the "Delete" key, instead of the
    >> factory-default binding of "^?".
    >>
    >> I think the scan-code for the "Delete" key is 83 (although I'm not
    >> sure). So I would like to remap the physical scan code for the key
    >> "Delete" in the console keyboard to be assigned "^[[3~" by OSR5, as is
    >> typical in other systems, mainly Linux.
    >>
    >> When at the OSR507 console, the TERM type I have configured is
    >> "ansi-850". I guess then I need either to edit that definition, or to
    >> simply remap the key "Delete" with a command unknown to me (something
    >> similar to what "xmodmap" does for X).
    >>
    >> However, I didn't find out how to do it. As I said,
    >> "/usr/lib/keyboard/strings" omits the "Delete" key...
    >>
    >> Also, my physical keyboard is mapped to "ps.850.spa", and
    >> "/usr/lib/keyboard/keys" is probably the map file to modify, but I don't
    >> know exactly how to shoehorn "^[[3~" for scan code 83 in it...

    >
    > Brian's explanation contains the bits you need for success, but in my
    > opinion you are going about this wrong and Brian's specific advice
    > (after his correct general purpose advice) only helps you continue to go
    > about it wrong.
    >
    > Your OSR5 system will be happiest if the DEL key sends the ASCII DEL
    > character (0x7F, displayed as "^?" by OSR5 `stty` command). Instead of
    > fighting that, you should allow it to send what it normally sends.
    >
    > Your stated reason for changing it is that you want the DEL key to do
    > something different from the BackSpace key. There is a standard,
    > traditional way to do that: have the BackSpace key send the ASCII
    > BackSpace sequence (0x08, ^H).
    >
    > The terminal emulator you are using to connect to the OSR5 box will have
    > a setting for that.


    But suppose the OSR5 system is deployed as a data entry terminal, to be used
    by the data entry operator at the system console (that is, the local
    keyboard and local VGA) in pure text-mode (no X Window System). I don't want
    to deal with the user moaning about the "weird keys" and so forth.

    So I want to remap the "Delete" key keyboard scan code to bind it to
    "^[[3~".

    > Once your terminal is sending ^H for BackSpace, you want:
    >
    > stty intr ^C erase ^H
    >
    > (which you can probably abbreviate to just "stty intr ^C" since ^H is
    > the default erase key).
    >
    > Then, depending of course on the application you are running, ^H will
    > erase-left and DEL will erase-right. DEL currently does erase-left
    > because you told it to, with your stty settings.


    I'm experiments with OSR507, as the "Delete" keyboard scan code is mapped to
    "^?", it never does delete-right in the system console, but always
    delete-left. That is what I want to remap, at the physical console level.

    > Notice that if you continued on your current path, DEL would start
    > sending ESC[3~, but no application on OSR5 would be expecting that
    > sequence, so they would just do something weird. Then you would have to
    > start editing the native SCO "ansi" terminal definitions to tell it that
    > ESC[3~ means "user hit a key labeled DEL". This would lead to a cascade
    > of further pain that you might eventually completely resolve, or which
    > might continue to cause small oddities forever.


    I guess that the application should read from the keyboard driver, which in
    turn should read the scan code produced from the physical device (keyboard),
    and it should be the keyboard driver's business to map the scan code from
    the "Delete" key to "whatever". Should be transparent for the application,
    unless the application is directly reading the keyboard scan codes.

    So, what is the keyboard map file I have to edit to bind the "Delete"
    console keyboard scan code to "^[[3~" (I assume all responsability in case
    the system collapses) ?

    Regards,

    Pepe.





  6. Re: How to make "delete" key work on current character?

    Pepe wrote:
    >
    > I guess that the application should read from the keyboard driver, which in
    > turn should read the scan code produced from the physical device (keyboard),
    > and it should be the keyboard driver's business to map the scan code from
    > the "Delete" key to "whatever". Should be transparent for the application,
    > unless the application is directly reading the keyboard scan codes.


    I think you have this all wrong. Terminal applications on Unix typically
    use the "curses" library. Go to your OpenServer system, log in and type
    man getch
    Read the bit about "FUNCTION KEYS"

    Applications don't see scan codes.


    I imagine what happens is often something not entirely like this ...

    I log on.
    I implicitly set the value of environment variable TERM to "foo".
    I invoke my application.
    My application invokes some curses function to await input.
    The curses function asks the OS to wake it when input arrives.
    I press F3.
    Interrupts get generated, OS routines get invoked.
    The OS decides that my app needs to know
    The OS sees my app has TERM=foo
    The OS reads terminfo/foo and sees "F3=Esc$%^&*ick!"
    The OS hands "Esc$%^&*ick!" to curses.
    The curses library checks TERM, reads terminfo/foo and decides I
    must have pressed F3 for it to have received "Esc$%^&*ick!".
    The curses getch() function returns the value 0413.
    In curses.h 0413 is defined as the value of a constant named "KEY_F3".
    My application reaches some conditional statement involving KEY_F3 ...

    Much of the above would be the same if I was using a serial terminal or
    a Telnet session via a terminal emulator running on a Mac. It is
    important that the application doesn't have to care whether the user is
    sitting at the console, sitting at a remote WinXP box or at a serial
    terminal etc.

    >
    > So, what is the keyboard map file I have to edit to bind the "Delete"
    > console keyboard scan code to "^[[3~" (I assume all responsability in case
    > the system collapses) ?
    >


    You have an X-Y problem.
    http://www.perlmonks.org/index.pl?node_id=542341

    Bela and Brian told you the best way to achieve X (which is not Y).

  7. Re: How to make "delete" key work on current character?

    In article , Pepe wrote:
    >Hello.
    >
    >In OpenServer 5.0.7, I've already configured "stty intr ^C erase ^?" as
    >I'm more used to that.
    >
    >However, I have a key still not to my liking: the "Delete" key (it says
    >"Delete" on the keyboard). Currently, it does a "deletion of the
    >character to the left of the cursor" (also known as "backspace" or
    >"rubout", I think). I would like it to do a "deletion of the character
    >above cursor", as it usually does in MS-DOS, Windows and Linux.
    >
    >When in Linux/Bash console, if I press "Ctrl-V", then "Delete", the
    >escape sequence that gets printed is "^[[3~" (without the quotation
    >marks). When in OSR507 at the console, also running Bash (installed by
    >default from MP5), if I press "Ctrl-V", then "Delete", it gets printed
    >"^?" (without the quotes). So I guess I need to know how do I shoehorn
    >"^[[3~" instead of "^?" intro the "Delete" key.
    >
    >Is that right? How is it done?


    No, mapping delete to delete to ^[[3~ wouldn't get the effect you want.
    See the section "Commands for Changing Text" in the bash man page,
    particularly "delete-char" and "forward-backward-delete-char", either of which
    might give the effect you want. Note that only delete-char has any binding by
    default, and it's ^D that's it's bound to, not ^[[3~. Notice that "Rubout"
    (the delete key) is bound to "backward-delete-char" by default.
    If you do 'bind -P' in bash under Linux you will probably find that ^[[3~ *is*
    bound to something.
    You can changing the bindings, for bash and anything else that uses the
    readline library, as described elsewhere in the bash man page. This won't
    affect anything that doesn't use the readline library.

    >(Coincidentally, in "/usr/lib/keyboard/strings" many control keys are
    >listed and defined, but the "Delete" key is missing; there is a "Shift
    >Delete", "Ctrl Delete" and "Alt Delete", but no "Delete" by itself. Is
    >it a reserved key in OSR5 or something?)


    No, it's just that it doesn't need string mapping, since it produces only a
    single character. Mapping the delete key to ^[[3~ would be a matter of first
    making it a function key by changing the appropriate instance of "del" in
    /usr/lib/keyboard/keys to be a function key (fkey), and then mapping that
    function key to the sequence you want in /usr/lib/keyboard/strings. But again
    - making it produce that sequence won't give the effect you want, because the
    key bindings for bash are probably different, the terminal definitions are
    different, etc.

    John
    --
    John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/

+ Reply to Thread