mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Change the default command prompts
This commit is contained in:
parent
ce9bdbb0bf
commit
82f2e758c7
6 changed files with 18 additions and 9 deletions
|
@ -5731,7 +5731,7 @@ retry:
|
||||||
linenoiseSetFreeHintsCallback(free);
|
linenoiseSetFreeHintsCallback(free);
|
||||||
linenoiseSetHintsCallback(ShellHint);
|
linenoiseSetHintsCallback(ShellHint);
|
||||||
linenoiseSetCompletionCallback(ShellCompletion);
|
linenoiseSetCompletionCallback(ShellCompletion);
|
||||||
if ((p = linenoiseWithHistory("$ ", "unbourne"))) {
|
if ((p = linenoiseWithHistory(">: ", "unbourne"))) {
|
||||||
nr = min(strlen(p), IBUFSIZ - 2);
|
nr = min(strlen(p), IBUFSIZ - 2);
|
||||||
memcpy(buf, p, nr);
|
memcpy(buf, p, nr);
|
||||||
buf[nr++] = '\n';
|
buf[nr++] = '\n';
|
||||||
|
|
4
third_party/lua/lua.main.c
vendored
4
third_party/lua/lua.main.c
vendored
|
@ -370,8 +370,8 @@ static int handle_luainit (lua_State *L) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(LUA_PROMPT)
|
#if !defined(LUA_PROMPT)
|
||||||
#define LUA_PROMPT "> "
|
#define LUA_PROMPT ">: "
|
||||||
#define LUA_PROMPT2 ">> "
|
#define LUA_PROMPT2 ">>: "
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(LUA_MAXINPUT)
|
#if !defined(LUA_MAXINPUT)
|
||||||
|
|
2
third_party/python/Python/pythonrun.c
vendored
2
third_party/python/Python/pythonrun.c
vendored
|
@ -101,7 +101,7 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename_str, PyCompilerFlags *
|
||||||
}
|
}
|
||||||
v = _PySys_GetObjectId(&PyId_ps1);
|
v = _PySys_GetObjectId(&PyId_ps1);
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
_PySys_SetObjectId(&PyId_ps1, v = PyUnicode_FromString(">>> "));
|
_PySys_SetObjectId(&PyId_ps1, v = PyUnicode_FromString(">>: "));
|
||||||
Py_XDECREF(v);
|
Py_XDECREF(v);
|
||||||
}
|
}
|
||||||
v = _PySys_GetObjectId(&PyId_ps2);
|
v = _PySys_GetObjectId(&PyId_ps2);
|
||||||
|
|
3
third_party/quickjs/libregexp.c
vendored
3
third_party/quickjs/libregexp.c
vendored
|
@ -510,6 +510,9 @@ int lre_parse_escape(const uint8_t **pp, int allow_utf16)
|
||||||
case 'f':
|
case 'f':
|
||||||
c = '\f';
|
c = '\f';
|
||||||
break;
|
break;
|
||||||
|
case 'e':
|
||||||
|
c = '\e'; /* [jart] love this */
|
||||||
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
c = '\n';
|
c = '\n';
|
||||||
break;
|
break;
|
||||||
|
|
10
third_party/quickjs/repl.js
vendored
10
third_party/quickjs/repl.js
vendored
|
@ -111,9 +111,9 @@ import * as os from "os";
|
||||||
var plen = 0;
|
var plen = 0;
|
||||||
var ps1;
|
var ps1;
|
||||||
if (config_numcalc)
|
if (config_numcalc)
|
||||||
ps1 = "> ";
|
ps1 = ">: ";
|
||||||
else
|
else
|
||||||
ps1 = "qjs > ";
|
ps1 = "qjs >: ";
|
||||||
var ps2 = " ... ";
|
var ps2 = " ... ";
|
||||||
var utf8 = true;
|
var utf8 = true;
|
||||||
var show_time = false;
|
var show_time = false;
|
||||||
|
@ -547,6 +547,11 @@ import * as os from "os";
|
||||||
this_fun = kill_region;
|
this_fun = kill_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clear_screen() {
|
||||||
|
std.puts("\e[H\e[2J");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
function kill_line() {
|
function kill_line() {
|
||||||
kill_region(cursor_pos, cmd.length, 1);
|
kill_region(cursor_pos, cmd.length, 1);
|
||||||
}
|
}
|
||||||
|
@ -743,6 +748,7 @@ import * as os from "os";
|
||||||
"\x09": completion, /* ^I - history-search-backward */
|
"\x09": completion, /* ^I - history-search-backward */
|
||||||
"\x0a": accept_line, /* ^J - newline */
|
"\x0a": accept_line, /* ^J - newline */
|
||||||
"\x0b": kill_line, /* ^K - delete to end of line */
|
"\x0b": kill_line, /* ^K - delete to end of line */
|
||||||
|
"\x0c": clear_screen, /* ^L - clear screen */
|
||||||
"\x0d": accept_line, /* ^M - enter */
|
"\x0d": accept_line, /* ^M - enter */
|
||||||
"\x0e": next_history, /* ^N - down */
|
"\x0e": next_history, /* ^N - down */
|
||||||
"\x10": previous_history, /* ^P - up */
|
"\x10": previous_history, /* ^P - up */
|
||||||
|
|
6
third_party/sqlite3/shell.c
vendored
6
third_party/sqlite3/shell.c
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
/* clang-format off */
|
||||||
/* DO NOT EDIT!
|
/* DO NOT EDIT!
|
||||||
** This file is automatically generated by the script in the canonical
|
** This file is automatically generated by the script in the canonical
|
||||||
** SQLite source tree at tool/mkshellc.tcl. That script combines source
|
** SQLite source tree at tool/mkshellc.tcl. That script combines source
|
||||||
|
@ -34,7 +35,6 @@
|
||||||
/* This needs to come before any includes for MSVC compiler */
|
/* This needs to come before any includes for MSVC compiler */
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
/* clang-format off */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Determine if we are dealing with WinRT, which provides only a subset of
|
** Determine if we are dealing with WinRT, which provides only a subset of
|
||||||
|
@ -20521,8 +20521,8 @@ static void main_init(ShellState *data) {
|
||||||
sqlite3_config(SQLITE_CONFIG_URI, 1);
|
sqlite3_config(SQLITE_CONFIG_URI, 1);
|
||||||
sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data);
|
sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data);
|
||||||
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
|
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
|
||||||
sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite> ");
|
sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite>: ");
|
||||||
sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...> ");
|
sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...>: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue