mirror of
https://git.freebsd.org/ports.git
synced 2025-07-07 04:19:17 -04:00
Import upstream commit 2c53b23d59 to make the cursor appear when running Emacs in a tmux nested inside another tmux session (this is particularly useful when trying to edit a text file on a remote server that is also running tmux). Approved by: mat (maintainer) Differential Revision: https://reviews.freebsd.org/D3408
35 lines
1 KiB
Text
35 lines
1 KiB
Text
commit 2c53b23d5968da2e796ead6ed9f8ff3c33b8bbfb
|
|
Author: nicm <nicm>
|
|
Date: Tue May 19 08:48:37 2015 +0000
|
|
|
|
In terminfo, sometimes cvvis implies cnorm and sometimes it doesn't, so
|
|
don't assume it does. Fixes missing cursor with emacs-in-tmux-in-tmux.
|
|
|
|
--- tty.c
|
|
+++ tty.c
|
|
@@ -507,14 +507,17 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
|
|
mode &= ~MODE_CURSOR;
|
|
|
|
changed = mode ^ tty->mode;
|
|
- if (changed & (MODE_CURSOR|MODE_BLINKING)) {
|
|
- if (mode & MODE_CURSOR) {
|
|
- if (mode & MODE_BLINKING &&
|
|
- tty_term_has(tty->term, TTYC_CVVIS))
|
|
- tty_putcode(tty, TTYC_CVVIS);
|
|
- else
|
|
- tty_putcode(tty, TTYC_CNORM);
|
|
- } else
|
|
+ if (changed & MODE_BLINKING) {
|
|
+ if (tty_term_has(tty->term, TTYC_CVVIS))
|
|
+ tty_putcode(tty, TTYC_CVVIS);
|
|
+ else
|
|
+ tty_putcode(tty, TTYC_CNORM);
|
|
+ changed |= MODE_CURSOR;
|
|
+ }
|
|
+ if (changed & MODE_CURSOR) {
|
|
+ if (mode & MODE_CURSOR)
|
|
+ tty_putcode(tty, TTYC_CNORM);
|
|
+ else
|
|
tty_putcode(tty, TTYC_CIVIS);
|
|
}
|
|
if (s != NULL && tty->cstyle != s->cstyle) {
|