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
88620e98
Commit
88620e98
authored
Dec 01, 2023
by
Michael Yang
Browse files
handle ctrl+z
parent
cedae0d1
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 @
88620e98
...
@@ -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