Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DSerial
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
apps
DSerial
Commits
6bf438a9
Commit
6bf438a9
authored
9 years ago
by
Isabella Skořepová
Browse files
Options
Downloads
Patches
Plain Diff
Proper terminal size detection & dont break line in s mode
parent
3d500465
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dserial-cli/src/commands/ReadCommand.vala
+12
-1
12 additions, 1 deletion
dserial-cli/src/commands/ReadCommand.vala
with
12 additions
and
1 deletion
dserial-cli/src/commands/ReadCommand.vala
+
12
−
1
View file @
6bf438a9
...
@@ -56,7 +56,18 @@ public class ReadCommand : Object, Command
...
@@ -56,7 +56,18 @@ public class ReadCommand : Object, Command
}
else
{
}
else
{
int
rows
;
int
rows
;
int
cols
;
int
cols
;
if
(!
state
.
interactive
)
Readline
.
initialize
();
Readline
.
get_screen_size
(
out
rows
,
out
cols
);
Readline
.
get_screen_size
(
out
rows
,
out
cols
);
if
(
rows
==
0
||
cols
==
0
)
{
string
?
v
=
Environment
.
get_variable
(
"LINES"
);
if
(
v
!=
null
)
rows
=
int
.
parse
(
v
);
v
=
Environment
.
get_variable
(
"COLUMNS"
);
if
(
v
!=
null
)
cols
=
int
.
parse
(
v
);
}
if
(
rows
==
0
||
cols
==
0
)
{
rows
=
23
;
cols
=
80
;
}
int
chars_per
=
0
;
int
chars_per
=
0
;
for
(
int
i
=
0
;
i
<
printers
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
printers
.
length
;
i
++)
{
chars_per
+=
printers
[
i
].
width_per_char
;
chars_per
+=
printers
[
i
].
width_per_char
;
...
@@ -97,7 +108,7 @@ public class ReadCommand : Object, Command
...
@@ -97,7 +108,7 @@ public class ReadCommand : Object, Command
stdout
.
printf
(
" "
);
stdout
.
printf
(
" "
);
printers
[
x
].
a
(
tmpbuf
);
printers
[
x
].
a
(
tmpbuf
);
}
}
stdout
.
printf
(
"\n"
);
if
(
display_fields
!=
"s"
)
stdout
.
printf
(
"\n"
);
counter
=
0
;
counter
=
0
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment