diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2016-10-09 14:38:41 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2016-10-09 14:38:41 +0200 |
commit | 3c4c4e08ed7280e7bc4de39c77f19e48d39743f9 (patch) | |
tree | 21a4963ab5acec9e02091247fcbca4ec054d1a2a /3rdparty | |
parent | d0ee476b0a4cfc8ba723f943b97abbfada0c1e9a (diff) |
Initial work on console interface (nw)
Use Ctrl-Z to close console on any OS. To start use -console parameter
Diffstat (limited to '3rdparty')
-rw-r--r-- | 3rdparty/linenoise-ng/src/linenoise.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/3rdparty/linenoise-ng/src/linenoise.cpp b/3rdparty/linenoise-ng/src/linenoise.cpp index 10ab72790bd..751c535d084 100644 --- a/3rdparty/linenoise-ng/src/linenoise.cpp +++ b/3rdparty/linenoise-ng/src/linenoise.cpp @@ -2281,11 +2281,11 @@ int InputBuffer::incrementalHistorySearch(PromptBase& pi, int startChar) { break; // job control is its own thing -#ifndef _WIN32 +//#ifndef _WIN32 case ctrlChar('Z'): // ctrl-Z, job control disableRawMode(); // Returning to Linux (whatever) shell, leave raw // mode - raise(SIGSTOP); // Break out in mid-line + // raise(SIGSTOP); // Break out in mid-line enableRawMode(); // Back from Linux shell, re-enter raw mode { bufferSize = historyLineLength + 1; @@ -2295,9 +2295,9 @@ int InputBuffer::incrementalHistorySearch(PromptBase& pi, int startChar) { dynamicRefresh(dp, tempUnicode.get(), historyLineLength, historyLinePosition); } - continue; - break; -#endif + fprintf(stdout, "\n"); + std::exit(0); +//#endif // these characters update the search string, and hence the selected input // line @@ -2929,16 +2929,18 @@ int InputBuffer::getInputLine(PromptBase& pi) { beep(); break; -#ifndef _WIN32 +//#ifndef _WIN32 case ctrlChar('Z'): // ctrl-Z, job control disableRawMode(); // Returning to Linux (whatever) shell, leave raw // mode - raise(SIGSTOP); // Break out in mid-line + //raise(SIGSTOP); // Break out in mid-line enableRawMode(); // Back from Linux shell, re-enter raw mode - if (!pi.write()) break; // Redraw prompt - refreshLine(pi); // Refresh the line - break; -#endif + //if (!pi.write()) break; // Redraw prompt + //refreshLine(pi); // Refresh the line + fprintf(stdout,"\n"); + std::exit(0); + //break; +//#endif // DEL, delete the character under the cursor case 127: |