Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
termion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
akitsu-sanae
termion
Commits
bf1a6ecc
Commit
bf1a6ecc
authored
8 years ago
by
Ticki
Browse files
Options
Downloads
Patches
Plain Diff
Amend #15
parent
f5936c00
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/size.rs
+2
-2
2 additions, 2 deletions
src/size.rs
with
2 additions
and
2 deletions
src/size.rs
+
2
−
2
View file @
bf1a6ecc
...
...
@@ -50,8 +50,8 @@ pub fn terminal_size() -> io::Result<(usize, usize)> {
pub
fn
terminal_size
()
->
io
::
Result
<
(
usize
,
usize
)
>
{
use
std
::
env
;
let
width
=
env
::
var
(
"COLUMNS"
)
.
unwrap_or
(
String
::
new
())
.parse
::
<
usize
>
()
.unwrap_or
(
0
);
let
height
=
env
::
var
(
"LINES"
)
.
unwrap_or
(
String
::
new
())
.parse
::
<
usize
>
()
.unwrap_or
(
0
);
let
width
=
try
!
(
env
::
var
(
"COLUMNS"
)
.
map_err
(|
x
|
io
::
Error
::
new
(
io
::
ErrorKind
::
NotFound
,
x
)))
.parse
()
.unwrap_or
(
0
);
let
height
=
try
!
(
env
::
var
(
"LINES"
)
.
map_err
(|
x
|
io
::
Error
::
new
(
io
::
ErrorKind
::
NotFound
,
x
)))
.parse
()
.unwrap_or
(
0
);
Ok
((
width
,
height
))
}
...
...
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