Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
919df09f
Commit
919df09f
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
general: detect in a better way whether we're running on a Linux console
Suggested-by:
Mike Frysinger
<
vapier@gentoo.org
>
parent
ddbff6dc
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nano.c
+7
-2
src/nano.c
with
7 additions
and
2 deletions
+7
-2
src/nano.c
View file @
919df09f
...
...
@@ -26,7 +26,7 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#if
n
def
NANO_TINY
#if
def
ined(__linux__) || !defined(
NANO_TINY
)
#include <sys/ioctl.h>
#endif
#ifdef ENABLE_UTF8
...
...
@@ -38,6 +38,9 @@
#include <termios.h>
#endif
#include <unistd.h>
#ifdef __linux__
#include <sys/vt.h>
#endif
#ifdef ENABLE_MOUSE
static
int
oldinterval
=
-
1
;
...
...
@@ -1988,8 +1991,10 @@ int main(int argc, char **argv)
};
#ifdef __linux__
struct
vt_stat
dummy
;
/* Check whether we're running on a Linux console. */
console
=
(
getenv
(
"DISPLAY"
)
==
NULL
);
console
=
(
ioctl
(
0
,
VT_GETSTATE
,
&
dummy
)
==
0
);
#endif
/* Back up the terminal settings so that they can be restored. */
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help