Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
e16e55d4
Commit
e16e55d4
authored
May 02, 2011
by
Juanma Barranquero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/sysdep.c (get_tty_size) [WINDOWSNT]: Implement.
Fixes: debbugs:8596
parent
9f5e78f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
src/ChangeLog
src/ChangeLog
+4
-0
src/sysdep.c
src/sysdep.c
+18
-8
No files found.
src/ChangeLog
View file @
e16e55d4
2011-05-02 Juanma Barranquero <lekktu@gmail.com>
* sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
2011-05-02 Juanma Barranquero <lekktu@gmail.com>
* gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
...
...
src/sysdep.c
View file @
e16e55d4
...
...
@@ -1125,8 +1125,7 @@ tabs_safe_p (int fd)
void
get_tty_size
(
int
fd
,
int
*
widthp
,
int
*
heightp
)
{
#ifdef TIOCGWINSZ
#if defined TIOCGWINSZ
/* BSD-style. */
struct
winsize
size
;
...
...
@@ -1139,8 +1138,7 @@ get_tty_size (int fd, int *widthp, int *heightp)
*
heightp
=
size
.
ws_row
;
}
#else
#ifdef TIOCGSIZE
#elif defined TIOCGSIZE
/* SunOS - style. */
struct
ttysize
size
;
...
...
@@ -1153,16 +1151,28 @@ get_tty_size (int fd, int *widthp, int *heightp)
*
heightp
=
size
.
ts_lines
;
}
#else
#ifdef MSDOS
#elif defined WINDOWSNT
CONSOLE_SCREEN_BUFFER_INFO
info
;
if
(
GetConsoleScreenBufferInfo
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
&
info
))
{
*
widthp
=
info
.
srWindow
.
Right
-
info
.
srWindow
.
Left
+
1
;
*
heightp
=
info
.
srWindow
.
Bottom
-
info
.
srWindow
.
Top
+
1
;
}
else
*
widthp
=
*
heightp
=
0
;
#elif defined MSDOS
*
widthp
=
ScreenCols
();
*
heightp
=
ScreenRows
();
#else
/* system doesn't know size */
*
widthp
=
0
;
*
heightp
=
0
;
#endif
#endif
/* not SunOS-style */
#endif
/* not BSD-style */
}
/* Set the logical window size associated with descriptor FD
...
...
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