Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
b3f6c659
Unverified
Commit
b3f6c659
authored
Dec 01, 2023
by
Michael Yang
Committed by
GitHub
Dec 01, 2023
Browse files
Merge pull request #1349 from jmorganca/mxyng/ctrl-z
handle ctrl+z
parents
cedae0d1
88620e98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
readline/readline.go
readline/readline.go
+9
-0
No files found.
readline/readline.go
View file @
b3f6c659
...
@@ -191,6 +191,15 @@ func (i *Instance) Readline() (string, error) {
...
@@ -191,6 +191,15 @@ func (i *Instance) Readline() (string, error) {
buf
.
ClearScreen
()
buf
.
ClearScreen
()
case
CharCtrlW
:
case
CharCtrlW
:
buf
.
DeleteWord
()
buf
.
DeleteWord
()
case
CharCtrlZ
:
if
err
:=
UnsetRawMode
(
fd
,
termios
);
err
!=
nil
{
return
""
,
err
}
syscall
.
Kill
(
0
,
syscall
.
SIGSTOP
)
// on resume...
return
""
,
nil
case
CharEnter
:
case
CharEnter
:
output
:=
buf
.
String
()
output
:=
buf
.
String
()
if
output
!=
""
{
if
output
!=
""
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment