How to setup terminal for ooRexx ?

  • U. Zinngrebe
    U. Zinngrebe

    When in interactive TRACE or running REXXTRY, the keyboard cursor keys stop working. Instead they generate control sequences which are displayed on the terminal.
    Before and after TRACE/REXXTRY the cursors work normally.
    The control sequences correspond to the Terminal control sequences, but have one different character (see below).
    The problem is present in the ooRexx betas and a 4843 build I made on this system (SUSE 11.1).

    I suspect it is a setup problem rather than a ooRexx bug, because Regina Rexx shows the same problem, but I have no idea where to continue. Could bash be between the keyboard and the terminal, and act differently when rexx is traced ?

    Cheeers, uli

    uli@ulmo:~/Desktop> rexx test
    2 - nop
    +++ Interactive trace. "Trace Off" to end debug. ENTER to continue.

    the cursor-left key generates ^[[D which corresponds to the keytab file entry

    key Left  -Shift-AnyMod+Ansi-AppCuKeys           : "\E[D"

    except that a character [ replaces E.

    uli@ulmo:~> uname -a
    Linux ulmo #1 SMP 2009-05-26 17:02:05 -0400 x86_64 x86_64 x86_64 GNU/Linux

    uli@ulmo:~> rexx -v
    Open Object Rexx Version 4.0.0
    Build date: Jun 24 2009
    Addressing Mode: 64

    uli@ulmo:~/Desktop> bash --version
    GNU bash, version 3.2.39(1)-release (x86_64-suse-linux-gnu)

    [README.default.Keytab] Buildin Keyboard Table

    Arrow keys in VT52 mode

    shift up/down are reserved for scrolling.

    shift left/right are reserved for switching between tabs (this is hardcoded).

    key Up -Shift-Ansi : "\EA"
    key Down -Shift-Ansi : "\EB"
    key Right-Shift-Ansi : "\EC"
    key Left -Shift-Ansi : "\ED"

    Arrow keys in ANSI mode with Application - and Normal Cursor Mode)

    key Up -Shift-AnyMod+Ansi+AppCuKeys : "\EOA"
    key Down -Shift-AnyMod+Ansi+AppCuKeys : "\EOB"
    key Right -Shift-AnyMod+Ansi+AppCuKeys : "\EOC"
    key Left -Shift-AnyMod+Ansi+AppCuKeys : "\EOD"

    key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A"
    key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B"
    key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C"
    key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D"

    key Up -Shift+AnyMod+Ansi : "\E[1;A"
    key Down -Shift+AnyMod+Ansi : "\E[1;
    key Right -Shift+AnyMod+Ansi : "\E[1;C"
    key Left -Shift+AnyMod+Ansi : "\E[1;

    • I think this is not a rexx problem. On Linux, Rexx simply reads a line using the standard system IO commands. As the characters are not handled by rexx, they just appear on console. I don't think there is a way to avoid it, besides writing some Rexx code that handles the array keys. (which probably wouldn't be very portable)

      On Windows, it seems like the line only gets passed on to the process when pressing return. Here, the cmd.exe handles the arrow keys.

      Correct me if I'm wrong.