-C CLI\sprompt\sdesign\schange:\s\sThe\sescape\scharacter\sis\schanged\sfrom\s\\sto\n%#37;.\s\sThis\savoids\slots\sof\squoting\sproblems\swhen\strying\sto\sspecify\sprompt\nstrings\sin\svarious\sprogramming\slanguages\sand\sshells.
-D 2026-04-11T22:58:25.521
+C Change\sthe\sprompt\sescape\sdesign\syet\sagain,\sto\suse\s/\sas\sthe\sescape\scharacter,\nsince\s%\sand\sjust\sabout\severy\sother\spunctuation\scharacter\sis\sspecial\sto\ncmd.exe,\sbatch\sfiles,\sand\snmake,\son\sWindows.
+D 2026-04-11T23:58:15.898
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 1984ce045f526350d9d5c896b1cf8016acd46a8f973e493e00d0837db07cbac4
+F src/shell.c.in 10db1d262638901afa657eab2410dd32abe2b3c087179899b5be1bde839baeb2
F src/sqlite.h.in a5605faa9479bbaac16c4ab43eb09ff50632004a8e05084d3fde56063ef73766
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 e8fb30de8ad201eeee0ba1f49505974010f1429f46f9e2c01f0dc6a4135f68cb
+F test/shell-prompt.sql 44b4aa9642ad21c11266c2e2c0d4538d40ca7ecf284366e4e20aeda51c6c674f
F test/shell1.test eda2e527435f139224dda67db6bbd2466597408d4fe5883d647d67fa32d88f7c
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 6fa0216a19c2f165110121227d3f9b9119369f8cd61f9c6d13eaa1ae42a60d60
-R 5cf6d69f7c518c6e5fa5be100b777a6a
+P e7e6ecc45dfe1a163d259be26877bd7e528ce154e73b3ca8ab7edc5aa94d2d02
+R 1310201927604bb87e94e7f880b7bec1
U drh
-Z 9c57625d95f1bb2a7bd8171d3c1fac72
+Z c7df6588beeea6afbae61f3c0c7ce22a
# Remove this line to create a well-formed Fossil manifest.
** The default prompts.
*/
#ifndef SQLITE_PS1
-# define SQLITE_PS1 "SQLite %f> "
+# define SQLITE_PS1 "SQLite /f> "
#endif
#ifndef SQLITE_PS2
-# define SQLITE_PS2 "%B...%H> "
+# define SQLITE_PS2 "/B.../H> "
#endif
/*
**
** Early prototypes use U+005c '\\' as the escape character. But
** that is an escape character for shells and C and many other languages,
-** which can lead to nested quoting problems and confusion. For that
-** reason, the escape character is changed to U+0025 '%'.
+** which can lead to nested quoting problems and confusion. The
+** U+0025 '%' character was also tried, and that works pretty well on
+** unix, but % is special to many formats on Windows. So now we
+** use a forward-slash, U+002f '/', which seems to pass through
+** every shell and "make" without issue.
*/
static char *expand_prompt(
ShellState *p, /* The current shell state */
int onoff = 1;
int idxSpace = -1;
for(i=0; zPrompt[i]; i++){
- if( zPrompt[i]!='%' ) continue;
+ if( zPrompt[i]!='/' ) continue;
if( i>0 ){
if( onoff ) sqlite3_str_append(pOut, zPrompt, i);
zPrompt += i;
i = 0;
}
- /* At this point zPrompt[0] is a % character and all prior
+ /* At this point zPrompt[0] is a / character and all prior
** characters have already been loaded into pOut. Process the
** escape sequence that zPrompt points to. */
c = zPrompt[1];
if( c==0 ){
- /* ~ at the end of a line is silently ignored */
+ /* / at the end of a line is silently ignored */
break;
}
- if( c=='%' ){
- /* %% maps into a single % */
+ if( c=='/' ){
+ /* // maps into a single / */
zPrompt++;
continue;
}
if( c>='0' && c<='7' ){
- /* %nnn becomes a single byte given by octal nnn */
+ /* /nnn becomes a single byte given by octal nnn */
int v = c - '0';
while( i<=2 && zPrompt[i+1]>='0' && zPrompt[i+1]<='7' ){
v = v*8 + zPrompt[++i] - '0';
continue;
}
if( c=='e' ){
- /* %e is shorthand for %033 which is U+001B "Escape" */
+ /* /e is shorthand for /033 which is U+001B "Escape" */
if( onoff ) sqlite3_str_append(pOut, "\033", 1);
zPrompt += 2;
i = -1;
/* The intent of the following codes it to provide alternative
** text displays depending on whether or not the connection is
** currently in a transaction. Example 1: Show a "*" before the ">"
- ** like psql:
+ ** like psql: (Note: We encode the "*" as /052 to avoid closing
+ ** out this comment.)
**
- ** .prompt 'sqlite%x*%;> '
+ ** .prompt 'sqlite/x/052/;> '
**
** Example 2: Show database filename is blue if not in a transaction,
** or red if within a transaction:
**
- ** .prompt '%e[1;%x31%:34%;m~f>%e[0m '
+ ** .prompt '/e[1;/x31/:34/;m~f>/e[0m '
*/
if( c==':' ){
/* toggle display on/off */
continue;
}
if( c=='x' ){
- /* %x turns display off not in a transaction, on if in txn */
+ /* /x turns display off not in a transaction, on if in txn */
onoff = p->db && !sqlite3_get_autocommit(p->db);
zPrompt += 2;
i = -1;
}
if( c=='f' || c=='F' || c=='~' ){
- /* %f becomes the tail of the database filename */
- /* %F becomes the full pathname */
- /* %~ becomes the full pathname relative to $HOME */
+ /* /f becomes the tail of the database filename */
+ /* /F becomes the full pathname */
+ /* /~ becomes the full pathname relative to $HOME */
if( onoff ){
const char *zFN = prompt_filename(p);
if( c=='f' ){
}
if( c=='H' ){
- /* %H becomes text needed to terminate current input */
+ /* /H becomes text needed to terminate current input */
if( onoff ){
sqlite3_int64 R = zPrior ? sqlite3_incomplete(zPrior) : 0;
int cc = (R>>16)&0xff;
}
if( c=='B' ){
- /* %B is a no-op for the main prompt. For the continuation prompt,
- ** %B expands to zero or more spaces to make the continuation prompt
+ /* /B is a no-op for the main prompt. For the continuation prompt,
+ ** /B expands to zero or more spaces to make the continuation prompt
** at least as wide as the main prompt. */
if( onoff ) idxSpace = sqlite3_str_length(pOut);
zPrompt += 2;
}
/* No match to a known escape. Generate an error. */
- if( onoff ) sqlite3_str_appendf(pOut,"UNKNOWN(\"%%%c\")",c);
+ if( onoff ) sqlite3_str_appendf(pOut,"UNKNOWN(\"/%c\")",c);
zPrompt += 2;
i = -1;
}
sqlite3_str_append(pOut, zPrompt, i);
}
- /* Expand the %B, if there is one and if this is a continuation prompt */
+ /* Expand the /B, if there is one and if this is a continuation prompt */
if( idxSpace>=0 && zPrior!=0 && zPrior[0]!=0 ){
char *zOther = expand_prompt(p, 0, prompt_string(p,0));
size_t wOther = sqlite3_qrf_wcswidth(zOther);