Screen Editing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas Dickey

    #46
    Re: Screen Editing

    Tak-Shing Chan <t.chan@gold.ac .ukwrote:
    On Fri, 17 Aug 2006, J. J. Farrell wrote:
    >You posted a long list which has no obvious relevance to the point in
    >question. The list is a long way from "most terminals" and few of the
    >ones listed count as modern (one was recently sold as a rare antique
    >computer, many are archaic museum pieces).
    OK. Let me trim it down to just one item: the Sun console.
    It is certainly still in use today, and it does clear the screen
    with '\f'. But you are absolutely right, this has little
    relevance to ``most terminals''. Perhaps I should s/most/some/g.
    yes - "some". As a colleague pointed out to me (quite a while ago),
    as I was modifying a terminal driver to do form-feeds, _printers_
    do form-feeds, terminals are not expected to do this.

    --
    Thomas E. Dickey
    Thomas Dickey develops/maintains widely-used tools and libraries for software development (diffstat, yacc, mawk) and terminals (ncurses, lynx, xterm)

    ftp://invisible-island.net

    Comment

    • Ian Collins

      #47
      Re: Screen Editing

      Tak-Shing Chan wrote:
      On Fri, 18 Aug 2006, Thomas Dickey wrote:
      >
      >Tak-Shing Chan <t.chan@gold.ac .ukwrote:
      >>
      >>On Fri, 18 Aug 2006, Thomas Dickey wrote:
      >>
      >>
      >>>Which are the ones running a widely-used non-vt100-compatible terminal?
      >>
      >>
      >> Widely-used? I don't know. But there exists systems where
      >>you can access the console thru the serial port---I've seen a
      >>few of those.
      >>
      >>
      >A serial port is a data connection (a wire)
      >It doesn't present data (a terminal).
      >
      >
      The serial driver doesn't, but the console driver does.
      >
      >Again, unless it's widely used, it doesn't add to the "most" category.
      >
      >
      Fair enough.
      >
      Getting rather off topic....

      --
      Ian Collins.

      Comment

      • Tak-Shing Chan

        #48
        Re: Screen Editing

        On Fri, 18 Aug 2006, Ian Collins wrote:
        Tak-Shing Chan wrote:
        >On Fri, 18 Aug 2006, Thomas Dickey wrote:
        >>
        >>Tak-Shing Chan <t.chan@gold.ac .ukwrote:
        >>>
        >>>On Fri, 18 Aug 2006, Thomas Dickey wrote:
        >>>
        >>>
        >>>>Which are the ones running a widely-used non-vt100-compatible terminal?
        >>>
        >>>
        >>> Widely-used? I don't know. But there exists systems where
        >>>you can access the console thru the serial port---I've seen a
        >>>few of those.
        >>>
        >>>
        >>A serial port is a data connection (a wire)
        >>It doesn't present data (a terminal).
        >>
        >>
        > The serial driver doesn't, but the console driver does.
        >>
        >>Again, unless it's widely used, it doesn't add to the "most" category.
        >>
        >>
        > Fair enough.
        >>
        Getting rather off topic....
        Sorry. I should volunterily ban myself from comp.lang.c
        for a month...

        Tak-Shing

        Comment

        • Keith Thompson

          #49
          Re: Screen Editing

          Tak-Shing Chan <t.chan@gold.ac .ukwrites:
          On Thu, 17 Aug 2006, Ancient_Hacker wrote:
          >someone wrote:
          >>I was just wondering if there is any way of editing anything already
          >>printed on the screen with out using the system("cls") command.
          >>
          >There is no "C" way to do this, as C precedes most CRT terminals,
          >
          What about ISO 9899:1990, 5.2.2, where escape sequences for
          display devices (such as '\f', '\b' and '\r') are defined? The
          only problem with these are quality of implementation issues.
          It says that \f (form feed) "moves the active position to the initial
          position at the start of the next logical page."

          I don't see anything there about clearing the screen.

          I think we all know by now that *some* terminals and terminal
          emulators will clear the screen in response to a formfeed characters,
          and some will not. (It happens that most of the ones I use or have
          access to don't. I suspect my experience in this case is typical; I
          certainly don't claim that it's universal.)

          In my opinion, the statement in question 19.4 of the FAQ that clearing
          the display by printing a formfeed character is "halfway portable" is
          incorrect, or at least over-stated.

          --
          Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
          San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
          We must do something. This is something. Therefore, we must do this.

          Comment

          • Tak-Shing Chan

            #50
            Re: Screen Editing

            On Fri, 18 Aug 2006, Keith Thompson wrote:
            Tak-Shing Chan <t.chan@gold.ac .ukwrites:
            >On Thu, 17 Aug 2006, Ancient_Hacker wrote:
            >>someone wrote:
            >>>I was just wondering if there is any way of editing anything already
            >>>printed on the screen with out using the system("cls") command.
            >>>
            >>There is no "C" way to do this, as C precedes most CRT terminals,
            >>
            > What about ISO 9899:1990, 5.2.2, where escape sequences for
            >display devices (such as '\f', '\b' and '\r') are defined? The
            >only problem with these are quality of implementation issues.
            >
            It says that \f (form feed) "moves the active position to the initial
            position at the start of the next logical page."
            >
            I don't see anything there about clearing the screen.
            >
            I think we all know by now that *some* terminals and terminal
            emulators will clear the screen in response to a formfeed characters,
            and some will not. (It happens that most of the ones I use or have
            access to don't. I suspect my experience in this case is typical; I
            certainly don't claim that it's universal.)
            >
            In my opinion, the statement in question 19.4 of the FAQ that clearing
            the display by printing a formfeed character is "halfway portable" is
            incorrect, or at least over-stated.
            I agree with you vis-a-vis '\f', but my reply above was an
            attempt to paint a larger picture---that it is indeed possible to
            ``edit'' something that is already written on the screen, if not
            by '\f', then by '\r' or '\b' on the current line.

            Tak-Shing

            Comment

            • Dik T. Winter

              #51
              Re: Screen Editing

              In article <Pine.GSO.4.61. 0608180221260.1 5025@scorpio.go ld.ac.ukTak-Shing Chan <t.chan@gold.ac .ukwrites:
              ....
              I agree with you vis-a-vis '\f', but my reply above was an
              attempt to paint a larger picture---that it is indeed possible to
              ``edit'' something that is already written on the screen, if not
              by '\f', then by '\r' or '\b' on the current line.
              An interesting discussion. But when I go back to what the OP posted
              it has gone a bit off-topic. And to get more off-topic, I have used
              a full-screen editor that worked across half-duplex lines, so it was
              only when you entered a CR that the base system knew what you had been
              doing. (FSE under NOS/VE on CDC Cybers.)
              --
              dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
              home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/

              Comment

              • Christopher Benson-Manica

                #52
                Re: Screen Editing

                Ben Pfaff <blp@cs.stanfor d.eduwrote:

                (WRT clearing the "screen")
                For some reason, no one liked this suggestion of mine when I
                brought it during the last discussion of this issue:
                for (;;)
                putchar('\n');
                How about

                {
                int idx, times=1;
                while( 1 ) {
                for( idx=0; idx < times; idx++ ) {
                putchar( '\n' );
                }
                printf( "Was that enough?\n" );
                if( getc(stdin) == 'n' ) {
                times++;
                continue;
                }
                break;
                }
                }

                ? This way the programmer can decide when the screen is clear enough,
                assuming of course I haven't made any silly mistakes.

                --
                C. Benson Manica | I *should* know what I'm talking about - if I
                cbmanica(at)gma il.com | don't, I need to know. Flames welcome.

                Comment

                Working...