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
8e0ef931
Unverified
Commit
8e0ef931
authored
Mar 08, 2024
by
Michael Yang
Committed by
GitHub
Mar 08, 2024
Browse files
Merge pull request #2990 from ollama/mxyng/default-term-size
fix: default terminal width, height
parents
280da445
b1e74d4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
readline/buffer.go
readline/buffer.go
+3
-4
No files found.
readline/buffer.go
View file @
8e0ef931
...
...
@@ -19,10 +19,9 @@ type Buffer struct {
func
NewBuffer
(
prompt
*
Prompt
)
(
*
Buffer
,
error
)
{
fd
:=
int
(
os
.
Stdout
.
Fd
())
width
,
height
,
err
:=
term
.
GetSize
(
fd
)
if
err
!=
nil
{
fmt
.
Println
(
"Error getting size:"
,
err
)
return
nil
,
err
width
,
height
:=
80
,
24
if
termWidth
,
termHeight
,
err
:=
term
.
GetSize
(
fd
);
err
==
nil
{
width
,
height
=
termWidth
,
termHeight
}
lwidth
:=
width
-
len
(
prompt
.
prompt
())
...
...
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