Fossil SCM
Enable linenoise multiline editing so long commands and queries may be seen all at once therefore highlighted and copied from xterms
Commit
03b6869856814edbff3cbec3792797a999e33e59
Parent
9c90682b02f39a2…
2 files changed
+1
+7
+1
| --- src/fshell.c | ||
| +++ src/fshell.c | ||
| @@ -61,10 +61,11 @@ | ||
| 61 | 61 | char *zLine = 0; |
| 62 | 62 | fDebug = find_option("debug", 0, 0)!=0; |
| 63 | 63 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 64 | 64 | db_close(0); |
| 65 | 65 | sqlite3_shutdown(); |
| 66 | + linenoiseSetMultiLine(1); | |
| 66 | 67 | while( (free(zLine), zLine = linenoise("fossil> ")) ){ |
| 67 | 68 | /* Remember shell history within the current session */ |
| 68 | 69 | linenoiseHistoryAdd(zLine); |
| 69 | 70 | |
| 70 | 71 | /* Parse the line of input */ |
| 71 | 72 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -61,10 +61,11 @@ | |
| 61 | char *zLine = 0; |
| 62 | fDebug = find_option("debug", 0, 0)!=0; |
| 63 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 64 | db_close(0); |
| 65 | sqlite3_shutdown(); |
| 66 | while( (free(zLine), zLine = linenoise("fossil> ")) ){ |
| 67 | /* Remember shell history within the current session */ |
| 68 | linenoiseHistoryAdd(zLine); |
| 69 | |
| 70 | /* Parse the line of input */ |
| 71 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -61,10 +61,11 @@ | |
| 61 | char *zLine = 0; |
| 62 | fDebug = find_option("debug", 0, 0)!=0; |
| 63 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 64 | db_close(0); |
| 65 | sqlite3_shutdown(); |
| 66 | linenoiseSetMultiLine(1); |
| 67 | while( (free(zLine), zLine = linenoise("fossil> ")) ){ |
| 68 | /* Remember shell history within the current session */ |
| 69 | linenoiseHistoryAdd(zLine); |
| 70 | |
| 71 | /* Parse the line of input */ |
| 72 |
+7
| --- src/sqlcmd.c | ||
| +++ src/sqlcmd.c | ||
| @@ -27,10 +27,14 @@ | ||
| 27 | 27 | # include "miniz.c" |
| 28 | 28 | #else |
| 29 | 29 | # include <zlib.h> |
| 30 | 30 | #endif |
| 31 | 31 | |
| 32 | +#ifndef _WIN32 | |
| 33 | +# include "linenoise.h" | |
| 34 | +#endif | |
| 35 | + | |
| 32 | 36 | /* |
| 33 | 37 | ** Implementation of the "content(X)" SQL function. Return the complete |
| 34 | 38 | ** content of artifact identified by X as a blob. |
| 35 | 39 | */ |
| 36 | 40 | static void sqlcmd_content( |
| @@ -200,10 +204,13 @@ | ||
| 200 | 204 | if( !noRepository ){ |
| 201 | 205 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 202 | 206 | } |
| 203 | 207 | fossil_close(1, noRepository); |
| 204 | 208 | sqlite3_shutdown(); |
| 209 | +#ifndef _WIN32 | |
| 210 | + linenoiseSetMultiLine(1); | |
| 211 | +#endif | |
| 205 | 212 | sqlite3_shell(g.argc-1, g.argv+1); |
| 206 | 213 | sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit); |
| 207 | 214 | fossil_close(0, noRepository); |
| 208 | 215 | } |
| 209 | 216 | |
| 210 | 217 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -27,10 +27,14 @@ | |
| 27 | # include "miniz.c" |
| 28 | #else |
| 29 | # include <zlib.h> |
| 30 | #endif |
| 31 | |
| 32 | /* |
| 33 | ** Implementation of the "content(X)" SQL function. Return the complete |
| 34 | ** content of artifact identified by X as a blob. |
| 35 | */ |
| 36 | static void sqlcmd_content( |
| @@ -200,10 +204,13 @@ | |
| 200 | if( !noRepository ){ |
| 201 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 202 | } |
| 203 | fossil_close(1, noRepository); |
| 204 | sqlite3_shutdown(); |
| 205 | sqlite3_shell(g.argc-1, g.argv+1); |
| 206 | sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit); |
| 207 | fossil_close(0, noRepository); |
| 208 | } |
| 209 | |
| 210 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -27,10 +27,14 @@ | |
| 27 | # include "miniz.c" |
| 28 | #else |
| 29 | # include <zlib.h> |
| 30 | #endif |
| 31 | |
| 32 | #ifndef _WIN32 |
| 33 | # include "linenoise.h" |
| 34 | #endif |
| 35 | |
| 36 | /* |
| 37 | ** Implementation of the "content(X)" SQL function. Return the complete |
| 38 | ** content of artifact identified by X as a blob. |
| 39 | */ |
| 40 | static void sqlcmd_content( |
| @@ -200,10 +204,13 @@ | |
| 204 | if( !noRepository ){ |
| 205 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 206 | } |
| 207 | fossil_close(1, noRepository); |
| 208 | sqlite3_shutdown(); |
| 209 | #ifndef _WIN32 |
| 210 | linenoiseSetMultiLine(1); |
| 211 | #endif |
| 212 | sqlite3_shell(g.argc-1, g.argv+1); |
| 213 | sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit); |
| 214 | fossil_close(0, noRepository); |
| 215 | } |
| 216 | |
| 217 |