summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tty-term.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-06-05 09:32:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-06-05 09:32:16 +0000
commitd0ff3efb690a3dc69aec4490eb5ae735072c9da7 (patch)
treeac0c5e7d12f5797397e0c6efdcbfba6141ae6808 /usr.bin/tmux/tty-term.c
parentf986aab267920bb055a21d241c1b5f2171c75bf8 (diff)
Fix various confusion about am vs xenl.
Diffstat (limited to 'usr.bin/tmux/tty-term.c')
-rw-r--r--usr.bin/tmux/tty-term.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c
index 9fc710fc98a..0b826c2c8e5 100644
--- a/usr.bin/tmux/tty-term.c
+++ b/usr.bin/tmux/tty-term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-term.c,v 1.81 2020/05/16 16:44:54 nicm Exp $ */
+/* $OpenBSD: tty-term.c,v 1.82 2020/06/05 09:32:15 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -54,6 +54,7 @@ struct tty_term_code_entry {
static const struct tty_term_code_entry tty_term_codes[] = {
[TTYC_ACSC] = { TTYCODE_STRING, "acsc" },
+ [TTYC_AM] = { TTYCODE_FLAG, "am" },
[TTYC_AX] = { TTYCODE_FLAG, "AX" },
[TTYC_BCE] = { TTYCODE_FLAG, "bce" },
[TTYC_BEL] = { TTYCODE_STRING, "bel" },
@@ -274,7 +275,6 @@ static const struct tty_term_code_entry tty_term_codes[] = {
[TTYC_TSL] = { TTYCODE_STRING, "tsl" },
[TTYC_U8] = { TTYCODE_NUMBER, "U8" },
[TTYC_VPA] = { TTYCODE_STRING, "vpa" },
- [TTYC_XENL] = { TTYCODE_FLAG, "xenl" },
[TTYC_XT] = { TTYCODE_FLAG, "XT" }
};
@@ -580,17 +580,22 @@ tty_term_create(struct tty *tty, char *name, int *feat, int fd, char **cause)
tty_term_apply_overrides(term);
/*
- * Terminals without xenl (eat newline glitch) wrap at at $COLUMNS - 1
+ * Terminals without am (auto right margin) wrap at at $COLUMNS - 1
* rather than $COLUMNS (the cursor can never be beyond $COLUMNS - 1).
*
- * This is irritating, most notably because it is impossible to write
- * to the very bottom-right of the screen without scrolling.
+ * Terminals without xenl (eat newline glitch) ignore a newline beyond
+ * the right edge of the terminal, but tmux doesn't care about this -
+ * it always uses absolute only moves the cursor with a newline when
+ * also sending a linefeed.
+ *
+ * This is irritating, most notably because it is painful to write to
+ * the very bottom-right of the screen without scrolling.
*
* Flag the terminal here and apply some workarounds in other places to
* do the best possible.
*/
- if (!tty_term_flag(term, TTYC_XENL))
- term->flags |= TERM_NOXENL;
+ if (!tty_term_flag(term, TTYC_AM))
+ term->flags |= TERM_NOAM;
/* Generate ACS table. If none is present, use nearest ASCII. */
memset(term->acs, 0, sizeof term->acs);