git://git.iain.cx/iain
/
profile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ec9402
)
Resize properly.
author
Iain Patterson
<me@iain.cx>
Thu, 6 Jan 2011 11:24:38 +0000
(11:24 +0000)
committer
Iain Patterson
<me@iain.cx>
Thu, 13 Jan 2011 11:38:59 +0000
(11:38 +0000)
tput doesn't work inside a subshell. Use stty size.
opt/bin/bigscreen
patch
|
blob
|
history
diff --git
a/opt/bin/bigscreen
b/opt/bin/bigscreen
index
df235b8
..
3f30b92
100755
(executable)
--- a/
opt/bin/bigscreen
+++ b/
opt/bin/bigscreen
@@
-6,7
+6,11
@@
#
# Resize only if we're at the default size.
-if [ "$(tput lines)" = "24" ]; then
- usize $(tput cols) 25
-fi
+size=$(stty size)
+oldcols=${size##* }
+oldlines=${size%% *}
+lines=${oldlines:-24}
+
+[ ${lines:-24} -lt 25 ] && lines=25
+[ $lines = $oldlines ] || usize $oldcols $lines
exec screen ${1+"$@"}