• Can't Control-C during a file search

    From Keyop Troy@1:103/705 to GitLab issue in main/sbbs on Mon Sep 18 13:52:43 2023
    open https://gitlab.synchro.net/main/sbbs/-/issues/638

    Scenario:[T]ransfer menu, [S]earch for a file, [A]ll files, enter some random text and press enter.The BBS then trawls through every file area looking for said file, but will not let a user break out via Control-C.User has to wait until 100% completion.Desired outcome - allow the user to escape using Control-C during the file search activity.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 14:55:14 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4175

    Ctrl-C abort these searches on Vertrauen (vert.synchro.net). I tried 'F' (description) and 'S' (filename) searches. Both were abortable with Ctrl-C.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Keyop Troy@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:19:40 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4176

    I've just tried on vert - and I can't control-C :-(Can we try spy mode?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Keyop Troy@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:23:22 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4177

    BTW I'm trying to do Control-C when the BBS is saying searching [0% ] [1% ]Is that when you are trying?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:27:35 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4178

    Yes, precisely that.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:31:03 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4179

    I can't Ctrl-C to cancel a file search on my BBS either. Is there perhaps a user setting that might affect this?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Keyop Troy@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:34:50 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4180

    I cant control-c with Qodem, but I can with Syncterm
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Keyop Troy@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:36:01 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4181

    and I can exit with telnet for windows and telnet for linux ...
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:39:05 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4182

    Sounds like Qodem isn't passing through Ctrl-C.Eric, are you checking console.aborted in the loops of your custom file listing mod?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Keyop Troy@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:41:12 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4183

    So with NightFox's DD utils/mods running I can't control-C out of the searching routine using any of the terminal emulator that allow me to control-c out of a stock search on vert.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 15:43:22 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4184

    That sounds like a flaw in Nightfox's mods then.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Keyop Troy@1:103/705 to GitLab note in main/sbbs on Mon Sep 18 16:00:33 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4186

    Over to you NightFox :-)
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Tue Sep 19 08:49:01 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4189

    Yes, I am checking for console.aborted, for its own input routines. But I thought it was Synchronet doing the file searching and that the file lister loadable module doesn't run unless there are matching files found in the file directory? At the point where "searching \[0% \] \[1% \]" is shown, I'm not sure how my file lister would be involved for checking console.aborted
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Tue Sep 19 09:06:33 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4190

    It looks like it's not checking for console.aborted in the correct place. I've tried putting a check for console.aborted in ddfilelister toward the beginning and exiting if it's true, but it seems to think console.aborted is always false:~~~if (user.is_sysop) console.print("console.aborted: " + console.aborted + "\r\n");if (console.aborted) exit(0);~~~What conditions make console.aborted true?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Sep 19 10:58:35 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4194

    `console.aborted` is set to true when a user hits Ctrl-C while `console.abortable` is `true` and the control-key passthrough bit map (`console.ctrlkey_passthru`) does not have bit 3 (for Ctrl-C) set.There are other factors (e.g. Telnet binary mode, Telnet gateway mode) that can cause SBBS to just pass-through the Ctrl-Key (not set the `console.aborted` flag), but those are probably not a factor here.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 11:34:48 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4203

    Thanks for the info.If console.abortable is true and the passthrough doesn't have Ctrl-C, should ddfilelister get a keypress at startup and see if the user pressed Ctrl-C and set console.aborted to true? I tried doing the following when ddfilelister starts up, but it didn't seem to be much help - Although console.aborted is set to true, Synchronet continued to do the file scan through the rest of the file directories. I'm still not sure if the code below is what ddfilelister should be doing to enable aborting the file scan:~~~if (console.abortable && (console.ctrlkey_passthru & (1<<3)) == 0){ var userKey = console.inkey(K_NOECHO|K_NOSPIN|K_NOCRLF, 100); if (userKey == CTRL_C) console.aborted = true;}if (user.is_sysop) console.print("console.aborted: " + console.aborted + "\r\n"); // For debuggingif (console.aborted) exit(0);~~~
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 12:38:43 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4204

    No, you should never have to set `console.aborted` to `true` yourself or check specifically for `CTRL_C`. In fact, I wouldn't expect this code to actually *do* anything (`console.inkey()` will never return `CTRL_C` unless you have Ctrl-C in the control-key pass-through bitmap. Did you test this (e.g. add a debug log message in the `if(userKey == CTRL_C)` condition)? I wouldn't expect it to do anything.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 13:22:42 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4206

    I thought I had a log message showing it got Ctrl-C, but I was probably mistaken. Upon double-checking, I've confirmed it's not getting a Ctrl-C.

    Indeed, it seems this isn't doing anything to help.

    I don't know what ddfilelister needs to do to enable Ctrl-C to abort the file scan.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 14:09:28 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4210

    Is your script clearing the abort status (setting `console.aborted = false`) anywhere?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 14:35:41 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4211

    No, it doesn't set console.aborted to false anywhere
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 14:49:14 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4212

    So the built-in scan dirs logic will call your list files mod for each directory included in the search scope and check the aborted flag between each directory. So, if your script is only a list files script (you're not using a custom scan dirs module), then I would expect a Ctrl-C to at least (at minimum) abort the scan between consecutive directories searched. This would not require anything special done in the custom list files mod (other than to not *clear* the aborted status at any point).

    If you're wanting a search of each/single directory to be immediately abortable via Ctrl-C, then any loops in your list files mod will need to check for `console.aborted` and cancel their operations when it's `true`.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 17:16:17 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4216

    ddfilelister indeed does not clear the aborted status. If it also should never have to set console.aborted to true, then I feel like I'm at a bit of a loss. I don't know why Ctrl-C doesn't abort the file scan when ddfilelister is being used.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Wed Sep 20 17:19:15 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4218

    Are you searching multiple libraries or directories or just one directory?

    Have you tried different search scopes (directory, library, all) to see if you get different behavior?

    Have you tried printing the value of 'console.aborted', say, anytime your script terminates?
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Thu Sep 21 09:50:38 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4236

    In this case, ddfilelister will search just the directory with the given sub-board code each time it runs.

    I've tried different scopes, and it has the same behavior (ctrl-C doesn't stop the scan).

    I've printed the value of console.aborted just before my script terminates, and it looks like sometimes it's true but most of the time it's false. In each case, I'm pressing ctrl-C multiple times while the scan is running, and the scan continues until it has searched all directories for the scope I chose.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Sat Oct 7 14:07:13 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4287

    @rswindell I'm at a loss on this. I don't know what ddfilelister would need to do (that it's not currently doing) to allow Ctrl-C to abort a file search.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Oct 10 14:42:45 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4316

    I do plan to look more into this, create a test case and help to determine what's going with this issue.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Wed Oct 25 09:27:30 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4373

    I found that with both "find text" and "search filename" if I hold down ctrl-c then it'll abort pretty quickly.

    Also, I get a [press a key] after each group and rather then CTRL-C aborting at that point, it takes it as just a key press. Not sure if that helps.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Fri Nov 10 10:36:50 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4453

    Recently, I remember nelgin saying he seemed to be able to stop it on his BBS after pressing Ctrl-C several times. It seems it doesn't stop on my BBS. I made a debug version of ddfilelister to output ctrlkey_passthru, and it's showing it's 0 for both of our BBSes. Also, we've tried having ddfilelister output the value of console.aborted, and it seems even when console.aborted is true, the file search continues
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Fri Nov 10 10:47:55 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4454

    I did a bit of testing

    ~~~
    console.crlf();
    writeln("console aborted: "+console.aborted);
    console.pause();
    writeln("console aborted: "+console.aborted);
    if (console.aborted) {
    writeln("let's get outta here");
    exit(1);
    }
    ~~~

    When I get to the console.pause it displays:

    ~~~
    There are no files in Local Files - Text Files
    console aborted: false
    [press a key] - ctrl-c pressed here
    console aborted: true
    let's get outta here
    [ Scanning 0.4% ]
    There are no files in Local Files - Communications Programs
    console aborted: false
    [press a key] - ctrl-c pressed here
    console aborted: true
    let's get outta here
    ~~~

    So even though it hits an exit, the scan continues.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Fri Nov 10 17:10:26 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4455

    I think this change from 7 years ago might be the reason: https://gitlab.synchro.net/main/sbbs/-/commit/c22063f9fccc53ae7d8273e775b0878e3d31a528

    I'm not sure reverting that change is a good idea. Maybe?

    If your script returns -1 (e.g. `exit(-1)`) that should stop the scan, so you could do that conditionally based on if `console.aborted === true` or not (return 0 for normal/continue).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Fri Nov 10 18:11:05 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4457

    ~~~
    console.pause();
    if (console.aborted)
    exit(-1);
    ~~~

    Now at pause, if I press CTRL-C then it exits back to the menu immediately.

    It looks like that would resolve the issue.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Sat Nov 11 13:39:25 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4458

    That seems to help. It looks like I have to press Ctrl-C a few times for it to detect that console.aborted is true, but the file search does stop early.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Eric Oulashin on Sat Nov 11 15:20:29 2023
    Re: Can't Control-C during a file search
    By: Eric Oulashin to GitLab note in main/sbbs on Sat Nov 11 2023 01:39 pm

    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4458

    That seems to help. It looks like I have to press Ctrl-C a few times for it to detect that console.aborted is true, but the file search does stop early.
    I'll consider reverting that change from many years ago that clears the abort flag upon completion of executing a JS script. There's likely another/better solution to that.
    --
    digital man (rob)

    Sling Blade quote #25:
    Karl: they seen fit to put me in here and here I've been a great long while. Norco, CA WX: 81.7øF, 8.0% humidity, 0 mph ENE wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From nelgin@1:103/705 to All on Mon Nov 13 01:02:58 2023
    On Sat, 11 Nov 2023 15:20:29 -0800
    "Digital Man" (VERT) <VERT!Digital.Man@endofthelinebbs.com> wrote:

    Re: Can't Control-C during a file search
    By: Eric Oulashin to GitLab note in main/sbbs on Sat Nov 11 2023
    01:39 pm

    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4458

    That seems to help. It looks like I have to press Ctrl-C a few
    times for it to detect that console.aborted is true, but the file
    search does stop early.
    I'll consider reverting that change from many years ago that clears
    the abort flag upon completion of executing a JS script. There's
    likely another/better solution to that.

    Does that means that every script that relies on console.aborted to
    exit will need to manually clear it before exiting?
    --
    End Of The Line BBS - Plano, TX
    telnet endofthelinebbs.com 23
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to nelgin on Mon Nov 13 00:16:14 2023
    Re: Re: Can't Control-C during a file search
    By: nelgin to All on Mon Nov 13 2023 01:02 am

    On Sat, 11 Nov 2023 15:20:29 -0800
    "Digital Man" (VERT) <VERT!Digital.Man@endofthelinebbs.com> wrote:

    Re: Can't Control-C during a file search
    By: Eric Oulashin to GitLab note in main/sbbs on Sat Nov 11 2023
    01:39 pm

    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_4458

    That seems to help. It looks like I have to press Ctrl-C a few
    times for it to detect that console.aborted is true, but the file search does stop early.
    I'll consider reverting that change from many years ago that clears
    the abort flag upon completion of executing a JS script. There's
    likely another/better solution to that.

    Does that means that every script that relies on console.aborted to
    exit will need to manually clear it before exiting?

    console.aborted is automatically cleared in sbbs (not scripts), so no, that shouldn't be the case.
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #46:
    ISDN = Integrated Services Digital Network
    Norco, CA WX: 63.0øF, 30.0% humidity, 0 mph ENE wind, 0.00 inches rain/24hrs --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Wed Aug 7 23:24:11 2024
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_5470

    So looks like we can close this issue now (?).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Thu Aug 8 00:48:59 2024
    https://gitlab.synchro.net/main/sbbs/-/issues/638#note_5491

    I think so but I'll check tomorrow afternoon.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Keyop Troy@1:103/705 to GitLab issue in main/sbbs on Fri Sep 13 17:32:28 2024
    close https://gitlab.synchro.net/main/sbbs/-/issues/638
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)