aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-01-08 08:40:40 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-01-08 08:40:40 +0100
commit79f46752d465680ff50fda38a007998673f3f746 (patch)
treeae2eef98a40d189eae8c9df8472b8929040dad9e /degesch.c
parent2a180ee084d74e31ad1b849c54e585596f91133b (diff)
downloadxK-79f46752d465680ff50fda38a007998673f3f746.tar.gz
xK-79f46752d465680ff50fda38a007998673f3f746.tar.xz
xK-79f46752d465680ff50fda38a007998673f3f746.zip
degesch: make sure newlines are output correctly
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index 6b629d6..dbecd9a 100644
--- a/degesch.c
+++ b/degesch.c
@@ -2094,6 +2094,14 @@ init_terminal (void)
return false;
}
+ // Make sure newlines are output correctly
+ struct termios termios;
+ if (!tcgetattr (tty_fd, &termios))
+ {
+ termios.c_oflag |= ONLCR;
+ (void) tcsetattr (tty_fd, TCSADRAIN, &termios);
+ }
+
g_terminal.lines = tigetnum ("lines");
g_terminal.columns = tigetnum ("cols");
update_screen_size ();