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
9ec16f0f
Commit
9ec16f0f
authored
Oct 27, 2023
by
Jeffrey Morgan
Browse files
fix formatting when exiting `ollama run`
parent
57a58db1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
cmd/cmd.go
cmd/cmd.go
+1
-0
readline/readline.go
readline/readline.go
+4
-3
No files found.
cmd/cmd.go
View file @
9ec16f0f
...
@@ -561,6 +561,7 @@ func generateInteractive(cmd *cobra.Command, model string) error {
...
@@ -561,6 +561,7 @@ func generateInteractive(cmd *cobra.Command, model string) error {
line
,
err
:=
scanner
.
Readline
()
line
,
err
:=
scanner
.
Readline
()
switch
{
switch
{
case
errors
.
Is
(
err
,
io
.
EOF
)
:
case
errors
.
Is
(
err
,
io
.
EOF
)
:
fmt
.
Println
()
return
nil
return
nil
case
errors
.
Is
(
err
,
readline
.
ErrInterrupt
)
:
case
errors
.
Is
(
err
,
readline
.
ErrInterrupt
)
:
if
line
==
""
{
if
line
==
""
{
...
...
readline/readline.go
View file @
9ec16f0f
...
@@ -76,14 +76,15 @@ func (i *Instance) Readline() (string, error) {
...
@@ -76,14 +76,15 @@ func (i *Instance) Readline() (string, error) {
}
}
r
,
err
:=
i
.
Terminal
.
Read
()
r
,
err
:=
i
.
Terminal
.
Read
()
if
err
!=
nil
{
return
""
,
io
.
EOF
}
if
buf
.
IsEmpty
()
{
if
buf
.
IsEmpty
()
{
fmt
.
Print
(
ClearToEOL
)
fmt
.
Print
(
ClearToEOL
)
}
}
if
err
!=
nil
{
return
""
,
io
.
EOF
}
if
escex
{
if
escex
{
escex
=
false
escex
=
false
...
...
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