diff --git a/xtrn/ddfilelister/ddfilelister.js b/xtrn/ddfilelister/ddfilelister.js index bc676e9a80cb5a0179c20cf56719a951e3666f71..4d96078a777e937f1cc58e9e59c126cbd639d3db 100644 --- a/xtrn/ddfilelister/ddfilelister.js +++ b/xtrn/ddfilelister/ddfilelister.js @@ -93,10 +93,23 @@ * If true (default), then when started as a loadable module, replace the * "# Files Listed" text with an empty string so that it won't be displayed * after exit + * 2023-11-11 Eric Oulashin Version 2.15a + * On start, if console.aborted is true (due to the user pressing Ctrl-C, etc.), + * then return -1 to stop a file scan in progress. */ "use strict"; +//js.on_exit("console.ctrlkey_passthru = " + console.ctrlkey_passthru); +//console.ctrlkey_passthru |= (1<<3); // Ctrl-C +//console.ctrlkey_passthru = "+C"; +//console.ctrlkey_passthru = "-C"; + + +// If the search action has been aborted, then return -1 +if (console.aborted) + exit(-1); + // This script requires Synchronet version 3.19 or newer. // If the Synchronet version is below the minimum, then exit. if (system.version_num < 31900) @@ -125,9 +138,10 @@ require("scrollbar.js", "ScrollBar"); require("mouse_getkey.js", "mouse_getkey"); require("attr_conv.js", "convertAttrsToSyncPerSysCfg"); + // Lister version information -var LISTER_VERSION = "2.15"; -var LISTER_DATE = "2023-09-17"; +var LISTER_VERSION = "2.15a"; +var LISTER_DATE = "2023-11-11"; /////////////////////////////////////////////////////////////////////////////// @@ -284,7 +298,7 @@ var gBlankNFilesListedStrIfLoadableModule = true; readConfigFile(); // Parse command-line arguments (which sets program options) -parseArgs(argv); +var gRunningAsLoadableModule = parseArgs(argv); // If set to use the traditional (non-lightbar) UI and if set to use the Synchronet // stock file lister, then do so instead of using ddfilelister's traditional UI @@ -307,25 +321,29 @@ var gFileList = []; // filename length and terminal width. var listPopRetObj = populateFileList(gScriptMode); if (listPopRetObj.exitNow) - exit(listPopRetObj.exitCode); + exit(0); // listPopRetObj.exitCode -// If there are no files, then say so and exit. +// If there are no files, then say so (if not running as a loadable module) and exit. +console.line_counter = 0; if (gFileList.length == 0) { - console.crlf(); - console.attributes = "NC"; - if (gScriptMode == MODE_LIST_DIR) + if (!gRunningAsLoadableModule) { - if (gFilespec == "*" || gFilespec == "*.*") - console.print("There are no files in the directory."); + console.crlf(); + console.attributes = "NC"; + if (gScriptMode == MODE_LIST_DIR) + { + if (gFilespec == "*" || gFilespec == "*.*") + console.print("There are no files in the directory."); + else + console.print("No files in the directory were found matching " + gFilespec); + } else - console.print("No files in the directory were found matching " + gFilespec); + console.print("No files were found."); + console.attributes = "N"; + console.crlf(); + //console.pause(); } - else - console.print("No files were found."); - console.attributes = "N"; - console.crlf(); - console.pause(); exit(0); } @@ -2963,6 +2981,7 @@ function createFileListMenu(pQuitKeys) { var originalCurPos = console.getxy(); displayFileLibAndDirHeader(true, gFileList[pIdx].dirCode, gFileListMenu.numberedMode); + if (user.is_sysop) console.print("\x01nHere!!!\r\n\x01p"); // Temporary console.gotoxy(originalCurPos); } } diff --git a/xtrn/ddfilelister/readme.txt b/xtrn/ddfilelister/readme.txt index 937668fd7249a4e4237448f9e668d223db3f3009..6cc23c41c8e6aeef23a4bc8f6269fdccbb6054c5 100644 --- a/xtrn/ddfilelister/readme.txt +++ b/xtrn/ddfilelister/readme.txt @@ -1,6 +1,6 @@ Digital Distortion File Lister - Version 2.15 - Release date: 2023-09-17 + Version 2.15a + Release date: 2023-11-11 by diff --git a/xtrn/ddfilelister/revision_history.txt b/xtrn/ddfilelister/revision_history.txt index 075c312742fd1c54fba31ea80893f882cd7d4ff7..90e3097546a249d6c78ab53695a2c1d2e059eddf 100644 --- a/xtrn/ddfilelister/revision_history.txt +++ b/xtrn/ddfilelister/revision_history.txt @@ -5,6 +5,9 @@ Revision History (change log) ============================= Version Date Description ------- ---- ----------- +2.15a 2023-11-11 On start, if console.aborted is true (due to the user + pressing Ctrl-C, etc.), then return -1 to stop a file + scan in progress. 2.15 2023-09-17 Fix for "Empty directory" message after quitting (the lister must exit with the number of files listed). Also, updates for filename searching. Also, note ddfilelister is