• ncurses and "application mode"

    From Rainer Weikusat@21:1/5 to All on Tue Nov 9 22:30:22 2021
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode"
    and back, with the effect of programs using it expecting the arrow keys
    to generate escape sequences starting with ESC O instead of ESC ]. This
    single character exchange seems a most useless exercise to me (and I've
    just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gary R. Schmidt@21:1/5 to Rainer Weikusat on Wed Nov 10 18:12:42 2021
    On 10/11/2021 09:30, Rainer Weikusat wrote:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode"
    and back, with the effect of programs using it expecting the arrow keys
    to generate escape sequences starting with ESC O instead of ESC ]. This single character exchange seems a most useless exercise to me (and I've
    just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for?

    Have a look at the terminfo/termcap definitions for your device, that's
    where it will be.

    Cheers,
    Gary B-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to Gary R. Schmidt on Wed Nov 10 10:36:23 2021
    In article <sv7s5i-40n.ln1@paranoia.mcleod-schmidt.id.au>,
    Gary R. Schmidt <grschmidt@acm.org> wrote:
    On 10/11/2021 09:30, Rainer Weikusat wrote:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode"
    and back, with the effect of programs using it expecting the arrow keys
    to generate escape sequences starting with ESC O instead of ESC ]. This
    single character exchange seems a most useless exercise to me (and I've
    just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for?

    Have a look at the terminfo/termcap definitions for your device, that's
    where it will be.

    I don't think you two are speaking the same language. I.e., you are not answering the question he is asking.

    I.e., he is asking a "Why?" question, you are answering a "Help me. My
    program doesn't work!" question.

    Note: Usenet (and all other online help forums) don't do well with "Why?"
    type questions.

    --
    Donald Drumpf claims to be "the least racist person you'll ever meet".

    This would be true if the only other person you've ever met was David Duke.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gary R. Schmidt@21:1/5 to Kenny McCormack on Wed Nov 10 22:33:47 2021
    On 10/11/2021 21:36, Kenny McCormack wrote:
    In article <sv7s5i-40n.ln1@paranoia.mcleod-schmidt.id.au>,
    Gary R. Schmidt <grschmidt@acm.org> wrote:
    On 10/11/2021 09:30, Rainer Weikusat wrote:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode"
    and back, with the effect of programs using it expecting the arrow keys
    to generate escape sequences starting with ESC O instead of ESC ]. This
    single character exchange seems a most useless exercise to me (and I've
    just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for?

    Have a look at the terminfo/termcap definitions for your device, that's
    where it will be.

    I don't think you two are speaking the same language. I.e., you are not answering the question he is asking.

    I.e., he is asking a "Why?" question, you are answering a "Help me. My program doesn't work!" question.

    Note: Usenet (and all other online help forums) don't do well with "Why?" type questions.

    You may be right - I think he doesn't understand how curses/ncurses
    works, and thinks that the library is emitting something that is not
    read from the termcap/terminfo description of his device.

    Cheers,
    Gary B-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Kettlewell@21:1/5 to Rainer Weikusat on Wed Nov 10 12:53:10 2021
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode"
    and back, with the effect of programs using it expecting the arrow keys
    to generate escape sequences starting with ESC O instead of ESC ]. This single character exchange seems a most useless exercise to me (and I've
    just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for?

    https://invisible-island.net/ncurses/ncurses.faq.html and search down
    for ‘Keyboard Problems’.

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to Richard Kettlewell on Wed Nov 10 15:28:22 2021
    Richard Kettlewell <invalid@invalid.invalid> writes:
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode"
    and back, with the effect of programs using it expecting the arrow keys
    to generate escape sequences starting with ESC O instead of ESC ]. This
    single character exchange seems a most useless exercise to me (and I've
    just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for?

    https://invisible-island.net/ncurses/ncurses.faq.html and search down
    for ‘Keyboard Problems’.

    Short version: Workaround for crappy, long obsolete hardware text
    terminals. That much I guessed. :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to Gary R. Schmidt on Wed Nov 10 15:24:54 2021
    "Gary R. Schmidt" <grschmidt@acm.org> writes:
    On 10/11/2021 21:36, Kenny McCormack wrote:
    In article <sv7s5i-40n.ln1@paranoia.mcleod-schmidt.id.au>,
    Gary R. Schmidt <grschmidt@acm.org> wrote:
    On 10/11/2021 09:30, Rainer Weikusat wrote:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode" >>>> and back, with the effect of programs using it expecting the arrow keys >>>> to generate escape sequences starting with ESC O instead of ESC ]. This >>>> single character exchange seems a most useless exercise to me (and I've >>>> just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for? >>>>
    Have a look at the terminfo/termcap definitions for your device, that's
    where it will be.

    I don't think you two are speaking the same language. I.e., you are not
    answering the question he is asking.

    I.e., he is asking a "Why?" question, you are answering a "Help me. My
    program doesn't work!" question.

    Note: Usenet (and all other online help forums) don't do well with "Why?"
    type questions.

    You may be right - I think he doesn't understand how curses/ncurses
    works, and thinks that the library is emitting something that is not
    read from the termcap/terminfo description of his device.

    You think entirely wrongly. Ncurses switches a terminal into something
    called "application mode" (using the escape sequencs ^]]1h) which has
    the effect of changing the escape sequence sent for an arrow up key from
    ^]]A to ^]OA (same scheme for the other arrow keys), the point of which
    escapes me. I'm assuming that's some compatibility feature for something ancient (and presumably, long extinct) and was asking if someone knew
    what this was (or is) supposed to be good for because I'm curiou about
    it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to DozingDog@thekennel.co on Wed Nov 10 18:00:53 2021
    DozingDog@thekennel.co writes:
    On Wed, 10 Nov 2021 15:28:22 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    Richard Kettlewell <invalid@invalid.invalid> writes:
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode" >>>> and back, with the effect of programs using it expecting the arrow keys >>>> to generate escape sequences starting with ESC O instead of ESC ]. This >>>> single character exchange seems a most useless exercise to me (and I've >>>> just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for? >>>
    https://invisible-island.net/ncurses/ncurses.faq.html and search down
    for ‘Keyboard Problems’.

    Short version: Workaround for crappy, long obsolete hardware text >>terminals. That much I guessed. :-)

    When 99.9% of terminals now are ansi why bother using curses? Skip the middle man and write the ansi codes direct , its much faster.

    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to
    support ncurses applications in a certain environment. I'm also
    interested in information about the ESC [ vs ESC O issue, ie why do
    vtXYZ terminals and emulations of them support switching from ] as second charater in an escape sequences to O as second character.

    Semirandom reply to your statement: Considering that computers are
    thousands of times (presumably too little) faster today than they used
    to be in 1985 or even in the 1990s, why bother with hard-coding a
    certain set of escape sequences "because that's faster"? Talk about
    solving a non-problem ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Rainer Weikusat on Wed Nov 10 17:16:03 2021
    On Wed, 10 Nov 2021 15:28:22 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    Richard Kettlewell <invalid@invalid.invalid> writes:
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    The ncurses library apparently (ie, it happens but I'm just assuming
    it's done by it) switches a terminal into so-called "application mode"
    and back, with the effect of programs using it expecting the arrow keys
    to generate escape sequences starting with ESC O instead of ESC ]. This
    single character exchange seems a most useless exercise to me (and I've
    just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for?

    https://invisible-island.net/ncurses/ncurses.faq.html and search down
    for ‘Keyboard Problems’.

    Short version: Workaround for crappy, long obsolete hardware text
    terminals. That much I guessed. :-)

    When 99.9% of terminals now are ansi why bother using curses? Skip the middle man and write the ansi codes direct , its much faster.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to DozingDog@thekennel.co on Wed Nov 10 17:48:08 2021
    In article <smguoj$1q7s$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote:
    ...
    When 99.9% of terminals now are ansi why bother using curses? Skip the middle

    Do You have a cite (URL) for that statistic?

    I think I've heard that is was only 99.3%, but maybe things have changed recently?

    --
    If the automobile had followed the same development cycle as the
    computer, a Rolls-Royce today would cost $100, get a million miles to
    the gallon, and explode once every few weeks, killing everyone inside.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gary R. Schmidt@21:1/5 to Rainer Weikusat on Thu Nov 11 17:34:15 2021
    On 11/11/2021 02:24, Rainer Weikusat wrote:
    "Gary R. Schmidt" <grschmidt@acm.org> writes:
    On 10/11/2021 21:36, Kenny McCormack wrote:
    In article <sv7s5i-40n.ln1@paranoia.mcleod-schmidt.id.au>,
    Gary R. Schmidt <grschmidt@acm.org> wrote:
    On 10/11/2021 09:30, Rainer Weikusat wrote:
    The ncurses library apparently (ie, it happens but I'm just assuming >>>>> it's done by it) switches a terminal into so-called "application mode" >>>>> and back, with the effect of programs using it expecting the arrow keys >>>>> to generate escape sequences starting with ESC O instead of ESC ]. This >>>>> single character exchange seems a most useless exercise to me (and I've >>>>> just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for? >>>>>
    Have a look at the terminfo/termcap definitions for your device, that's >>>> where it will be.

    I don't think you two are speaking the same language. I.e., you are not >>> answering the question he is asking.

    I.e., he is asking a "Why?" question, you are answering a "Help me. My
    program doesn't work!" question.

    Note: Usenet (and all other online help forums) don't do well with "Why?" >>> type questions.

    You may be right - I think he doesn't understand how curses/ncurses
    works, and thinks that the library is emitting something that is not
    read from the termcap/terminfo description of his device.

    You think entirely wrongly. Ncurses switches a terminal into something
    called "application mode" (using the escape sequencs ^]]1h) which has
    the effect of changing the escape sequence sent for an arrow up key from
    ^]]A to ^]OA (same scheme for the other arrow keys), the point of which escapes me. I'm assuming that's some compatibility feature for something ancient (and presumably, long extinct) and was asking if someone knew
    what this was (or is) supposed to be good for because I'm curiou about
    it.

    Ah, you want "comp.terminals", not "comp.unix.programmer".

    It has nothing to do with curses/ncurses as such, but *why* the terminal definition tell curses/ncures to spit out such strings.

    Cheers,
    Gary B-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Rainer Weikusat on Thu Nov 11 10:02:36 2021
    On Wed, 10 Nov 2021 18:00:53 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Wed, 10 Nov 2021 15:28:22 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    Richard Kettlewell <invalid@invalid.invalid> writes:
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    The ncurses library apparently (ie, it happens but I'm just assuming >>>>> it's done by it) switches a terminal into so-called "application mode" >>>>> and back, with the effect of programs using it expecting the arrow keys >>>>> to generate escape sequences starting with ESC O instead of ESC ]. This >>>>> single character exchange seems a most useless exercise to me (and I've >>>>> just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for? >>>>
    https://invisible-island.net/ncurses/ncurses.faq.html and search down
    for ‘Keyboard Problems’.

    Short version: Workaround for crappy, long obsolete hardware text >>>terminals. That much I guessed. :-)

    When 99.9% of terminals now are ansi why bother using curses? Skip the middle

    man and write the ansi codes direct , its much faster.

    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't. Newsflash - this is usenet. If you want a private conversation use email otherwise stop whining.

    Semirandom reply to your statement: Considering that computers are
    thousands of times (presumably too little) faster today than they used
    to be in 1985 or even in the 1990s, why bother with hard-coding a
    certain set of escape sequences "because that's faster"? Talk about
    solving a non-problem ...

    An array containing a few escape codes then just using printf() instead of juggling curses specific API calls is IMO a lot simpler from a coding POV
    as well as being faster.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Kenny McCormack on Thu Nov 11 10:00:35 2021
    On Wed, 10 Nov 2021 17:48:08 -0000 (UTC)
    gazelle@shell.xmission.com (Kenny McCormack) wrote:
    In article <smguoj$1q7s$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote: >....
    When 99.9% of terminals now are ansi why bother using curses? Skip the middle

    Do You have a cite (URL) for that statistic?

    I think I've heard that is was only 99.3%, but maybe things have changed >recently?

    Given almost nobody uses real terminals anymore (and even then most of them
    are ansi or at least vt* compatible) I think its a fair assumption. In fact
    the number of virtual terminals in use compared to real terminals is probably way higher than 1/1000 so its probably more like 99.9999%.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to DozingDog@thekennel.co on Thu Nov 11 11:56:07 2021
    In article <smipk3$1inv$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote:
    On Wed, 10 Nov 2021 17:48:08 -0000 (UTC)
    gazelle@shell.xmission.com (Kenny McCormack) wrote:
    In article <smguoj$1q7s$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote: >>....
    When 99.9% of terminals now are ansi why bother using curses? Skip
    the middle

    Do You have a cite (URL) for that statistic?

    I think I've heard that is was only 99.3%, but maybe things have changed >>recently?

    Given almost nobody uses real terminals anymore (and even then most of them >are ansi or at least vt* compatible) I think its a fair assumption. In fact >the number of virtual terminals in use compared to real terminals is probably >way higher than 1/1000 so its probably more like 99.9999%.

    Heh heh. Missing the point, much?

    --
    There are many self-professed Christians who seem to think that because
    they believe in Jesus' sacrifice they can reject Jesus' teachings about
    how we should treat others. In this country, they show that they reject
    Jesus' teachings by voting for Republicans.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Kenny McCormack on Thu Nov 11 16:09:25 2021
    On Thu, 11 Nov 2021 11:56:07 -0000 (UTC)
    gazelle@shell.xmission.com (Kenny McCormack) wrote:
    In article <smipk3$1inv$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote: >>On Wed, 10 Nov 2021 17:48:08 -0000 (UTC)
    gazelle@shell.xmission.com (Kenny McCormack) wrote:
    In article <smguoj$1q7s$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote: >>>....
    When 99.9% of terminals now are ansi why bother using curses? Skip
    the middle

    Do You have a cite (URL) for that statistic?

    I think I've heard that is was only 99.3%, but maybe things have changed >>>recently?

    Given almost nobody uses real terminals anymore (and even then most of them >>are ansi or at least vt* compatible) I think its a fair assumption. In fact >>the number of virtual terminals in use compared to real terminals is probably >>way higher than 1/1000 so its probably more like 99.9999%.

    Heh heh. Missing the point, much?

    Probably missing what you think is the point.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to James Kuyper on Thu Nov 11 16:10:16 2021
    On Thu, 11 Nov 2021 11:06:07 -0500
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 11/11/21 5:02 AM, DozingDog@thekennel.co wrote:
    On Wed, 10 Nov 2021 18:00:53 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    ....
    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't.

    You certainly could. What you mean is "I won't".

    Then he should have asked "Will you please refrain".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to DozingDog@thekennel.co on Thu Nov 11 11:06:07 2021
    On 11/11/21 5:02 AM, DozingDog@thekennel.co wrote:
    On Wed, 10 Nov 2021 18:00:53 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    ...
    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't.

    You certainly could. What you mean is "I won't".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to DozingDog@thekennel.co on Thu Nov 11 13:15:25 2021
    On 11/11/21 11:10 AM, DozingDog@thekennel.co wrote:
    On Thu, 11 Nov 2021 11:06:07 -0500
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 11/11/21 5:02 AM, DozingDog@thekennel.co wrote:
    On Wed, 10 Nov 2021 18:00:53 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    ....
    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to >>>
    No, I couldn't.

    You certainly could. What you mean is "I won't".

    Then he should have asked "Will you please refrain".

    Not necessarily. He might have had doubts about your physical ability to restrain yourself. I gave you the benefit of the doubt by assuming that
    you do have that ability, and just choose not to exercise it. That's not
    much of a benefit - being unwilling to do so is almost as pathetic as
    not being able to do so.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to James Kuyper on Fri Nov 12 10:46:46 2021
    On Thu, 11 Nov 2021 13:15:25 -0500
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 11/11/21 11:10 AM, DozingDog@thekennel.co wrote:
    On Thu, 11 Nov 2021 11:06:07 -0500
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 11/11/21 5:02 AM, DozingDog@thekennel.co wrote:
    On Wed, 10 Nov 2021 18:00:53 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    ....
    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to >>>>
    No, I couldn't.

    You certainly could. What you mean is "I won't".

    Then he should have asked "Will you please refrain".

    Not necessarily. He might have had doubts about your physical ability to >restrain yourself. I gave you the benefit of the doubt by assuming that
    you do have that ability, and just choose not to exercise it. That's not
    much of a benefit - being unwilling to do so is almost as pathetic as
    not being able to do so.

    I'd reserve "pathetic" for someone who thinks a polite verbal disagreement requires restraint.

    You might not be in your 20s but you're one of the spiritual ancestors of the sad wet woke generation we're suffering now.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)