-C Improvements\sto\sthe\sprompt_filename()\sfunction\sin\sthe\sCLI\sso\sthat\sit\sfinds\nthe\sdatabase\sfilename\seven\sif\sthe\sconnection\sis\snot\syet\sfully\sopen.
-D 2026-04-13T11:34:15.710
+C ".prompt"\scommand\simprovements\sin\sthe\sCLI:\s\sGuard\sagainst\smistakenly\ssaying\n".prompt\sshow"\swithout\sthe\s"--"\sbefore\s"show".\s\sAdd\sthe\s--hard-reset\soption\nto\s.prompt\sto\smake\sit\smore\seasily\stestable.
+D 2026-04-13T12:22:16.855
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F src/resolve.c 928ff887f2a7c64275182060d94d06fdddbe32226c569781cf7e7edc6f58d7fd
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c ffe199f025a0dd74670d2a77232bdea364a4d7b36f32c64a6572d39ba6a11576
-F src/shell.c.in 34f1f4a7f86df2309bad20160c345ca8ded319971eb8e1d8e3d439770e64c140
+F src/shell.c.in ae5a629eb8249ab5d5b61271a05e2c55b1b060794f44c5d41482dca3fb134a0c
F src/sqlite.h.in 39d2e09114d2bdb7afd998f4a469c8f8cd065f8093835a7d0422f260fc78fb4f
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
F src/sqlite3ext.h 9788c301f95370fa30e808861f1d2e6f022a816ddbe2a4f67486784c1b31db2e
F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
-F test/shell-prompt.sql b91e31fd768a88a1b978c3d3527e408bbee605075aacabada785935c43ceacb7
+F test/shell-prompt.sql 5c18599f2b7566172007005206471aefb7e0be593e8f52d37b9ab03a12aa84a6
F test/shell1.test c84eff209f93ad17ccdf7e1634969fc8231684254edeb21d9b13d67c3179cdb5
F test/shell2.test dc541d2681503e55466a24d35a4cbf8ca5b90b8fcdef37fc4db07373a67d31d3
F test/shell3.test 91efdd545097a61a1f72cf79c9ad5b49da080f3f10282eaf4c3c272cd1012db2
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P 414ae4dd65182ce571a6abb1a1a2ba2c169b204156f4f8923c42f64805a3ef9f
-R cf324d5615b6d300c87a4273e5c0525e
+P efb3e808a0281014512a812920d526a4909467e925ea000956606318bb6f2e65
+R 035153f7005ed7a44d470f0958cdf837
U drh
-Z 7119036f9ab631d62dd86cf043f46eef
+Z 8362c43c0870219aedf4cc04f1e11cb5
# Remove this line to create a well-formed Fossil manifest.
" --timeout S Halt after running for S seconds",
#endif
".prompt MAIN CONTINUE Replace the standard prompts",
+ " --hard-reset Unset SQLITE_PS1/2 and then --reset",
" --reset Revert to default prompts",
" --show Show the current prompt strings",
" -- No more options. Subsequent args are prompts",
const char *z = azArg[i];
if( z[0]=='-' && !noOpt ){
if( z[1]=='-' ) z++;
+ if( strcmp(z,"-hard-reset")==0 ){
+ unsetenv("SQLITE_PS1");
+ unsetenv("SQLITE_PS2");
+ z += 5;
+ }
if( strcmp(z,"-reset")==0 ){
free(p->azPrompt[0]);
free(p->azPrompt[1]);
dotCmdError(p, i, "extra argument", 0);
rc = 1;
goto meta_command_exit;
+ }else if( !p->dot.abQuot[i] && sqlite3_strglob("*[^a-z]*",z)!=0 ){
+ dotCmdError(p, i, "use quotes around the prompt string", 0);
}else{
free(p->azPrompt[cnt]);
p->azPrompt[cnt] = strdup(z);
.testcase setup
.open -new test.db
.mode list -quote off -escape ascii
+.prompt --hard-reset
.check ''
.testcase 100
Continuation: '/B.../H> '
END
+.testcase 120 --error-prefix ERROR:
+.prompt show
+.check <<END
+ERROR: .prompt show
+ERROR: ^--- use quotes around the prompt string
+END
+
+.testcase 121
+.prompt 'show'
+.check ''
+.testcase 122
+.prompt --show
+.check <<END
+Main prompt: 'show'
+Continuation: '/B.../H> '
+END
+
+.testcase 130
+.prompt --reset
+.help prompt
+.check <<END
+.prompt MAIN CONTINUE Replace the standard prompts
+ --hard-reset Unset SQLITE_PS1/2 and then --reset
+ --reset Revert to default prompts
+ --show Show the current prompt strings
+ -- No more options. Subsequent args are prompts
+END
+
+.testcase 140 --error-prefix ERROR:
+.prompt --xyz
+.check <<END
+ERROR: .prompt --xyz
+ERROR: ^--- unknown option
+END
.testcase 1000