Fossil SCM

Enable linenoise multiline editing so long commands and queries may be seen all at once therefore highlighted and copied from xterms

andygoth 2016-11-16 19:29 trunk
Commit 03b6869856814edbff3cbec3792797a999e33e59
--- src/fshell.c
+++ src/fshell.c
@@ -61,10 +61,11 @@
6161
char *zLine = 0;
6262
fDebug = find_option("debug", 0, 0)!=0;
6363
db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0);
6464
db_close(0);
6565
sqlite3_shutdown();
66
+ linenoiseSetMultiLine(1);
6667
while( (free(zLine), zLine = linenoise("fossil> ")) ){
6768
/* Remember shell history within the current session */
6869
linenoiseHistoryAdd(zLine);
6970
7071
/* Parse the line of input */
7172
--- 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
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -27,10 +27,14 @@
2727
# include "miniz.c"
2828
#else
2929
# include <zlib.h>
3030
#endif
3131
32
+#ifndef _WIN32
33
+# include "linenoise.h"
34
+#endif
35
+
3236
/*
3337
** Implementation of the "content(X)" SQL function. Return the complete
3438
** content of artifact identified by X as a blob.
3539
*/
3640
static void sqlcmd_content(
@@ -200,10 +204,13 @@
200204
if( !noRepository ){
201205
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
202206
}
203207
fossil_close(1, noRepository);
204208
sqlite3_shutdown();
209
+#ifndef _WIN32
210
+ linenoiseSetMultiLine(1);
211
+#endif
205212
sqlite3_shell(g.argc-1, g.argv+1);
206213
sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit);
207214
fossil_close(0, noRepository);
208215
}
209216
210217
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button