Skip to content
Browse files

ignore shell prompts at start of line to make it easier to copy-paste…

… user output
  • Loading branch information...
1 parent 7845a6e commit 0fabb0e31d58d85e09f0f51ec61447c5c0772026 @RedBeard0531 RedBeard0531 committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 shell/dbshell.cpp
View
10 shell/dbshell.cpp
@@ -377,6 +377,10 @@ string finishCode( string code ){
return "";
if ( ! line )
return "";
+
+ while (startsWith(line, "... "))
+ line += 4;
+
code += line;
}
return code;
@@ -616,9 +620,13 @@ int _main(int argc, char* argv[]) {
gotInterrupted = 0;
char * line = shellReadline( "> " );
- if ( line )
+ if ( line ){
+ while (startsWith(line, "> "))
+ line += 2;
+
while ( line[0] == ' ' )
line++;
+ }
if ( ! line || ( strlen(line) == 4 && strstr( line , "exit" ) ) ){
cout << "bye" << endl;

0 comments on commit 0fabb0e

Please sign in to comment.
Something went wrong with that request. Please try again.