• CTRL C in bbs.select_editor() returns "None"

    From Nigel Reed@VERT to GitLab issue in main/sbbs on Wed Sep 13 23:19:04 2023
    open https://gitlab.synchro.net/main/sbbs/-/issues/631

    select_editor works in direct contast to how select_shell works.

    If you're in the editor selector and press CTRL-C to abort, it returns as if you had not selected an edit (I guess returns 0) therefore the editor shows up as "None".

    I believe the correct result would be to return the current shell and only have "None" if the user should select no external editor.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Thu Sep 14 10:30:09 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/631#note_4042

    `bbs.select_editor()` returns a Boolean (true of false). If you're treating the return value as a number, you're doing it wrong. :-)

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nigel Reed@VERT to GitLab note in main/sbbs on Thu Sep 14 12:43:01 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/631#note_4043

    I'm not doing anything with the return value, I just think that when you use CTRL-C when selecting the editor, it should keep your existing editor or not set it to "None"

    So what you're telling me to do is a keep a note of which editor the user has selected in a variable, then check for console.aborted and if true, then set the user.editor back to what the variable value is.

    ~~~
    case 'E':
    if(console.noyes(bbs.text(UseExternalEditorQ))) {
    if(console.aborted) {
    console.aborted = false;
    break;
    }
    user.editor = '';
    }
    else
    bbs.select_editor();
    break;
    ~~~

    Why can't select_editor handle CTRL-C itself and return the current editor like select_shell does?

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Thu Sep 14 15:08:08 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/631#note_4044

    The way you worded the title of this issue, it sounded like you were talking about the return value of `bbs.select_editor()`.

    `bbs.select_editor()` does not change the current user's editor selection if they press Ctrl-C rather than choose one from the list of editors. Just like `bbs.select_shell()` behaves.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Thu Sep 14 15:11:21 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/631#note_4045

    So what you're telling me to do is a keep a note of which editor the user has selected in a variable, then check for console.aborted and if true, then set the user.editor back to what the variable value is.

    No, that should not be necessary. I tested this myself:
    `;eval bbs.select_editor()` then hit Ctrl-C

    And my user account's configured external editor remains what is before (is not changed to "None" as a result). So something else is afoot.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab issue in main/sbbs on Thu Sep 14 21:28:55 2023
    close https://gitlab.synchro.net/main/sbbs/-/issues/631

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