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
b1e74d4f
Commit
b1e74d4f
authored
Mar 07, 2024
by
Michael Yang
Browse files
default terminal width, height
parent
f678f5c5
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 @
b1e74d4f
...
...
@@ -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