projects
/
unix-history
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2dcd074
)
add "stty size" ala "stty speed"
author
Mike Karels
<karels@ucbvax.Berkeley.EDU>
Fri, 10 Jan 1986 11:56:30 +0000
(
03:56
-0800)
committer
Mike Karels
<karels@ucbvax.Berkeley.EDU>
Fri, 10 Jan 1986 11:56:30 +0000
(
03:56
-0800)
SCCS-vsn: bin/stty/stty.c 5.3
usr/src/bin/stty/stty.c
patch
|
blob
|
blame
|
history
diff --git
a/usr/src/bin/stty/stty.c
b/usr/src/bin/stty/stty.c
index
8a53e0f
..
7b0891c
100644
(file)
--- a/
usr/src/bin/stty/stty.c
+++ b/
usr/src/bin/stty/stty.c
@@
-287,6
+287,11
@@
char **iargv;
goto done;
win.ws_col = atoi(*++argv);
}
goto done;
win.ws_col = atoi(*++argv);
}
+ if (eq("size")) {
+ ioctl(open("/dev/tty", 0), TIOCGWINSZ, &win);
+ printf("%d %d\n", win.ws_row, win.ws_col);
+ exit(0);
+ }
for(i=0; speeds[i].string; i++)
if(eq(speeds[i].string)) {
mode.sg_ispeed = mode.sg_ospeed = speeds[i].speed;
for(i=0; speeds[i].string; i++)
if(eq(speeds[i].string)) {
mode.sg_ispeed = mode.sg_ospeed = speeds[i].speed;