Screen Editing

Discussion in 'C Programming' started by someone, Aug 17, 2006.

  1. Which are the ones running a widely-used non-vt100-compatible terminal?
     
    Thomas Dickey, Aug 18, 2006
    #41
    1. Advertisements

  2. 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.

    Tak-Shing
     
    Tak-Shing Chan, Aug 18, 2006
    #42
    1. Advertisements

  3. [/QUOTE]
    A serial port is a data connection (a wire)
    It doesn't present data (a terminal).

    Again, unless it's widely used, it doesn't add to the "most" category.
     
    Thomas Dickey, Aug 18, 2006
    #43
  4. 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.

    Tak-Shing
     
    Tak-Shing Chan, Aug 18, 2006
    #44
  5. The serial driver doesn't, but the console driver does.
    Fair enough.

    Tak-Shing
     
    Tak-Shing Chan, Aug 18, 2006
    #45
  6. 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 Dickey, Aug 18, 2006
    #46
  7. someone

    Ian Collins Guest

    Getting rather off topic....
     
    Ian Collins, Aug 18, 2006
    #47
  8. Sorry. I should volunterily ban myself from comp.lang.c
    for a month...

    Tak-Shing
     
    Tak-Shing Chan, Aug 18, 2006
    #48
  9. 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, Aug 18, 2006
    #49
  10. 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
     
    Tak-Shing Chan, Aug 18, 2006
    #50
  11. 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, Aug 18, 2006
    #51
  12. (WRT clearing the "screen")
    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.
     
    Christopher Benson-Manica, Aug 18, 2006
    #52
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.