• Initial design of Terminal class

    From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 20:53:55
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6864

    Having curattr being the current attribute was a similar experiment that didn't pan out either. I didn't bother creating a new property for that yet, though it's something that would be trivial to add... coming up with a good name is the hard part for that one.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 20:57:07
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6865

    In which case it doesn't matter since it will be cleared on user interaction.

    I've wanted to to a few animation things in the past with line counting enabled, but couldn't use the built-in pause support for (ie: Animate drawing boxes, cool transitions, etc).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 20:59:57
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6866

    If you have a demo/test for it, sure, but it's never been on my feature radar: once a script (or display file) starts moving the cursor around, I expected the script to be in full control of any output and input (and not depend on SBBS auto-pausing).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:08:34
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6867

    In this case, I would wonder: in what situation is lastlinelen not the length of the line line printed? I suppose one were to print "something\r", it'd be wrong (until such time as a linefeed was sent, then it'd be correct), but the only known use case for the lastlinelen is for *not* counting initial blank lines after user input, so it was not a problem. If we change it so that lastlinelen was only updated upon an output LF, I think that'd be a backward compatible change to the implementation and keep the intent of the variable/problem name. But I don't think there's any reason to pursue such a change as part of this MR.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:09:20
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6867

    In this case, I would wonder: in what situation is lastlinelen not the length of the line line printed? I suppose one were to print "something\r", it'd be wrong (until such time as a linefeed was sent, then it'd be correct), but the only known use case for the lastlinelen is for *not* counting initial blank lines after user input, so it was not a problem. If we change it so that lastlinelen was only updated upon an output LF, I think that'd be a backward compatible change to the implementation and keep the intent of the variable/property name. But I don't think there's any reason to pursue such a change as part of this MR.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:12:49
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6868

    Sure:

    ```
    console.clear();
    console.print("Line 1\r\n");
    console.print("Line 2\r\n");
    console.print("Line 2 is very important!");
    sleep(1000);
    console.up();
    console.left(18);
    console.print("\x01I<-- Very Important!\x01N");
    sleep(2000);
    console.left(19);
    console.cleartoeol();
    console.print("\r\n");
    console.cleartoeol();
    for (var i = 3; i < 29; i++)
    console.print(format("Line %d\r\n", i));
    ```

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:20:17
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6869

    I'm not sure what you're saying, but it seems like you're fine with how it is. The reason to change the JS property was simply to avoid someone trying to use it for something else and being frustrated that it doesn't do what they expect.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:21:22
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6870

    That demo seems to work on the master branch too, except that it prematurely auto-pauses on line 22. So yeah, your abstraction adds support for a new use case. :-)

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:31:09
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6871

    Yeah, it hasn't been a problem. But I also don't think anyone's used lastlinelen but me (in C++) and it's behaved how I expected where/when I've needed and used it so most likely nobody's had an opportunity to be frustrated with it. A simple use/test would likely show the property behaving as expected:
    ```
    print("test");
    print("last_line_length = " + console.last_line_length); // Prints 4, as advertised
    ```

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:53:25
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6876

    All implementations of Terminal::clearscreen() would need this, yeah?

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 21:56:24
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6877

    It seems the master branch doesn't do this clearing, but probably should have.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 22:23:34
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6879

    Master does it in outchar as part of the fall-through from the FF case.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 22:25:10
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6881

    Yeah, I missed the one in the header, fixed now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 22:28:20
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6882

    On the master branch, a direct call to clearscreen() e.g. from JS, for an ANSI terminal user, would not go through outcom() (and thus not hit any FF case):
    ```
    void sbbs_t::clearscreen(int term)
    {
    clear_hotspots();
    if (term & ANSI)
    putcom("\x1b[2J\x1b[H"); /* clear screen, home cursor */
    else if (term & PETSCII)
    outcom(PETSCII_CLEAR);
    else
    outcom(FF);
    row = 0;
    column = 0;
    lncntr = 0;
    }
    ```
    Probably a bug.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 22:31:21
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6883

    Yeah, no real way to guess at if anyone has tried using it and been frustrated.

    ```
    print("Test\r");
    print("last_line_length = " + console.last_line_length); // Prints 0, as advertised
    ```

    :smiley:

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 22:39:35
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6885

    Does console.clearscreen() not work? You said clearscreen example worked (unless you lucked out and the ;eval command exactly wrapped?)

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 22:40:45
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6886

    Aha!

    ```
    if (autopause)
    sbbs->CLS; // outchar(FF);
    else
    sbbs->clearscreen(sbbs->term_supports());
    ```

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to GitLab note in main/sbbs on Tuesday, March 25, 2025 22:42:21
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/506#note_6887

    So now console.clearscreen(false) needs to be fixed.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net