From 78b89d982f454e5504af21fa78826ab66c0408a4 Mon Sep 17 00:00:00 2001 From: Max Rees Date: Sun, 18 Aug 2019 21:51:13 -0500 Subject: user/xterm: fix regression when using tmux horizontal splits --- user/xterm/APKBUILD | 6 +- user/xterm/revert-xterm-347i.patch | 213 +++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 user/xterm/revert-xterm-347i.patch diff --git a/user/xterm/APKBUILD b/user/xterm/APKBUILD index 06c3a8dba..5c73b29fb 100644 --- a/user/xterm/APKBUILD +++ b/user/xterm/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Kiyoshi Aman pkgname=xterm pkgver=348 -pkgrel=1 +pkgrel=2 pkgdesc="An X-based terminal emulator" url="https://invisible-island.net/xterm/" arch="all" @@ -14,6 +14,7 @@ makedepends="libx11-dev libsm-dev libice-dev libxt-dev utmps-dev libxaw-dev subpackages="$pkgname-doc" source="https://invisible-mirror.net/archives/xterm/xterm-$pkgver.tgz posix-ptmx.patch + revert-xterm-347i.patch " build() { @@ -45,4 +46,5 @@ package() { } sha512sums="852896c0aba885bafc80baad899fc56910dce66bf5df6b3fef3f998efc33af9d30b68cfb0c92c7028365ac4944af3d3c198bc0e408ca09e949b993a79c1e6dd9 xterm-348.tgz -e29ef756243faa6f5ced3c74d6879b4fc8f9839501becae49af4f458d0f499bcda40a0eb66dada9cae8bf9789256daf3d1605ac1b5b4301654d8b5ac6eaca81d posix-ptmx.patch" +e29ef756243faa6f5ced3c74d6879b4fc8f9839501becae49af4f458d0f499bcda40a0eb66dada9cae8bf9789256daf3d1605ac1b5b4301654d8b5ac6eaca81d posix-ptmx.patch +e2a632ce02adf43e3936f79ac694b60bee3742b05ee5165a4e834af650db8e90a9135de2c5daa21be0448c02c0be862c7b688d3f1373a23d9b6db15ee67a7c81 revert-xterm-347i.patch" diff --git a/user/xterm/revert-xterm-347i.patch b/user/xterm/revert-xterm-347i.patch new file mode 100644 index 000000000..aa49ac3b9 --- /dev/null +++ b/user/xterm/revert-xterm-347i.patch @@ -0,0 +1,213 @@ +From 97ef79a674a13f806c58dc7d6eeeaa2e31cbca11 Mon Sep 17 00:00:00 2001 +From: Max Rees +Date: Sun, 18 Aug 2019 21:12:19 -0500 +Subject: [PATCH] Revert "snapshot of project "xterm", label xterm-347i" + +The changes introduced in xterm-347i cause a regression in tmux's +"horizontal" (read: one pane on the left, and one pane on the right) +splitting behavior, making the graphical output unstable and unreadable. + +This reverts commit 7914e2709aa7836bfb61cd21f83880d4b7d44d8d. +--- + charproc.c | 43 +++++++++++++++---------------------------- + screen.c | 5 +++-- + util.c | 3 +-- + xterm.h | 16 +++------------- + 4 files changed, 22 insertions(+), 45 deletions(-) + +diff --git a/charproc.c b/charproc.c +index 5c0536c..3b04842 100644 +--- a/charproc.c ++++ b/charproc.c +@@ -1280,7 +1280,7 @@ set_ansi_conformance(TScreen *screen, int level) + * Set scrolling margins. VTxxx terminals require that the top/bottom are + * different, so we have at least two lines in the scrolling region. + */ +-static void ++void + set_tb_margins(TScreen *screen, int top, int bottom) + { + TRACE(("set_tb_margins %d..%d, prior %d..%d\n", +@@ -1297,7 +1297,7 @@ set_tb_margins(TScreen *screen, int top, int bottom) + screen->bot_marg = screen->max_row; + } + +-static void ++void + set_lr_margins(TScreen *screen, int left, int right) + { + TRACE(("set_lr_margins %d..%d, prior %d..%d\n", +@@ -1317,26 +1317,13 @@ set_lr_margins(TScreen *screen, int left, int right) + #define reset_tb_margins(screen) set_tb_margins(screen, 0, screen->max_row) + #define reset_lr_margins(screen) set_lr_margins(screen, 0, screen->max_col) + +-void +-resetMargins(XtermWidget xw) ++static void ++reset_margins(TScreen *screen) + { +- TScreen *screen = TScreenOf(xw); +- +- UIntClr(xw->flags, LEFT_RIGHT); + reset_tb_margins(screen); + reset_lr_margins(screen); + } + +-static void +-resetRendition(XtermWidget xw) +-{ +- TScreen *screen = TScreenOf(xw); +- (void) screen; +- ResetItalics(xw); +- UIntClr(xw->flags, +- (SGR_MASK | SGR_MASK2 | INVISIBLE)); +-} +- + void + set_max_col(TScreen *screen, int cols) + { +@@ -3225,7 +3212,9 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) + case DEFAULT: + /* FALLTHRU */ + case 0: +- resetRendition(xw); ++ ResetItalics(xw); ++ UIntClr(xw->flags, ++ (SGR_MASK | SGR_MASK2 | INVISIBLE)); + if_OPT_ISO_COLORS(screen, { + reset_SGR_Colors(xw); + }); +@@ -3706,12 +3695,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) + TRACE(("CASE_DECALN - alignment test\n")); + if (screen->cursor_state) + HideCursor(); +- /* +- * DEC STD 070 does not mention left/right margins. Likely the +- * text was for VT100, and not updated for VT420. +- */ +- resetRendition(xw); +- resetMargins(xw); ++ reset_margins(screen); + CursorSet(screen, 0, 0, xw->flags); + xtermParseRect(xw, 0, 0, &myRect); + ScrnFillRectangle(xw, &myRect, 'E', 0, False); +@@ -6074,13 +6058,16 @@ dpmodes(XtermWidget xw, BitFunc func) + if (screen->c132) { + if (!(xw->flags & NOCLEAR_COLM)) + ClearScreen(xw); ++ CursorSet(screen, 0, 0, xw->flags); + if ((j = IsSM()? 132 : 80) != + ((xw->flags & IN132COLUMNS) ? 132 : 80) || + j != MaxCols(screen)) + RequestResize(xw, -1, j, True); + (*func) (&xw->flags, IN132COLUMNS); +- resetMargins(xw); +- CursorSet(screen, 0, 0, xw->flags); ++ if (xw->flags & IN132COLUMNS) { ++ UIntClr(xw->flags, LEFT_RIGHT); ++ reset_lr_margins(screen); ++ } + } + break; + case srm_DECSCLM: /* (slow scroll) */ +@@ -10636,7 +10623,7 @@ VTRealize(Widget w, + set_cur_row(screen, 0); + set_max_col(screen, Width(screen) / screen->fullVwin.f_width - 1); + set_max_row(screen, Height(screen) / screen->fullVwin.f_height - 1); +- resetMargins(xw); ++ reset_margins(screen); + + memset(screen->sc, 0, sizeof(screen->sc)); + +@@ -11951,7 +11938,7 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) + #endif + + /* reset scrolling region */ +- resetMargins(xw); ++ reset_margins(screen); + + bitclr(&xw->flags, ORIGIN); + +diff --git a/screen.c b/screen.c +index 4e8a0bf..2af76bc 100644 +--- a/screen.c ++++ b/screen.c +@@ -1,4 +1,4 @@ +-/* $XTermId: screen.c,v 1.578 2019/07/19 22:35:41 tom Exp $ */ ++/* $XTermId: screen.c,v 1.577 2019/06/30 18:45:09 tom Exp $ */ + + /* + * Copyright 1999-2018,2019 by Thomas E. Dickey +@@ -2236,7 +2236,8 @@ ScreenResize(XtermWidget xw, + } + + /* adjust scrolling region */ +- resetMargins(xw); ++ set_tb_margins(screen, 0, screen->max_row); ++ set_lr_margins(screen, 0, screen->max_col); + UIntClr(*flags, ORIGIN); + + if (screen->cur_row > screen->max_row) +diff --git a/util.c b/util.c +index 7623efa..7300300 100644 +--- a/util.c ++++ b/util.c +@@ -1,4 +1,4 @@ +-/* $XTermId: util.c,v 1.803 2019/07/20 00:10:34 tom Exp $ */ ++/* $XTermId: util.c,v 1.802 2019/07/19 00:40:41 tom Exp $ */ + + /* + * Copyright 1999-2018,2019 by Thomas E. Dickey +@@ -3687,7 +3687,6 @@ drawXtermText(XtermWidget xw, + #define NOT_BOLD (attr_flags & ~BOLDATTR(screen)) + font = getNormXftFont(xw, attr_flags, &did_ul); + font0 = IS_BOLD ? getNormXftFont(xw, NOT_BOLD, &did_ul) : font; +- (void) font0; + #if OPT_RENDERWIDE + wfont = getWideXftFont(xw, attr_flags); + wfont0 = IS_BOLD ? getWideXftFont(xw, NOT_BOLD) : wfont; +diff --git a/xterm.h b/xterm.h +index 89a4482..fecac7f 100644 +--- a/xterm.h ++++ b/xterm.h +@@ -1,4 +1,4 @@ +-/* $XTermId: xterm.h,v 1.841 2019/07/19 22:35:06 tom Exp $ */ ++/* $XTermId: xterm.h,v 1.839 2019/07/19 00:40:41 tom Exp $ */ + + /* + * Copyright 1999-2018,2019 by Thomas E. Dickey +@@ -957,11 +957,12 @@ extern void lookupSelectUnit(XtermWidget /* xw */, Cardinal /* item */, String / + extern void releaseCursorGCs(XtermWidget /*xw*/); + extern void releaseWindowGCs(XtermWidget /*xw*/, VTwin * /*win*/); + extern void resetCharsets (TScreen * /* screen */); +-extern void resetMargins (XtermWidget /* xw */); + extern void restoreCharsets (TScreen * /* screen */, DECNRCM_codes * /* source */); + extern void saveCharsets (TScreen * /* screen */, DECNRCM_codes * /* target */); + extern void set_max_col(TScreen * /* screen */, int /* cols */); + extern void set_max_row(TScreen * /* screen */, int /* rows */); ++extern void set_lr_margins (TScreen * /* screen */, int /* left */, int /* right */); ++extern void set_tb_margins (TScreen * /* screen */, int /* top */, int /* bottom */); + extern void unparse_end (XtermWidget /* xw */); + extern void unparseputc (XtermWidget /* xw */, int /* c */); + extern void unparseputc1 (XtermWidget /* xw */, int /* c */); +@@ -1406,17 +1407,6 @@ extern void LineSetFlag(LineData /* ld */, int /* flag */); + #define ScrnIsColInMargins(screen, col) \ + ((col) >= (screen)->lft_marg && (col) <= (screen)->rgt_marg) + +-/* +- * If the vertical scrolling margins are active, they will be something other +- * than the first/last row of the visible screen, as well as being distinct. +- */ +-#define IsTopBottomMode(xw) (ScrnTopMargin(xw) < ScrnBottomMargin(xw)) +-#define ScrnTopMargin(xw) TScreenOf(xw)->top_marg +-#define ScrnBottomMargin(xw) TScreenOf(xw)->bot_marg +- +-/* +- * Left/right horizontal scrolling margins are only active when DECLRMM is. +- */ + #define IsLeftRightMode(xw) ((xw)->flags & LEFT_RIGHT) + #define ScrnLeftMargin(xw) (IsLeftRightMode(xw) \ + ? TScreenOf(xw)->lft_marg \ +-- +2.22.1 + -- cgit v1.2.3-70-g09d2