Skip to content

Commit

Permalink
Revert terminal hacks and workarounds
Browse files Browse the repository at this point in the history
The extra redrawwin() added by b445bae
to fix a scrolling bug in (u)xterm is causing flickering when paging
in XTerm(370).

As the original issues with xterm and gnome-terminal cannot be
reproduced anymore even on a now antique distro, revert the
associated workarounds.

Fixes jonas#1180
  • Loading branch information
koutcher committed Feb 3, 2022
1 parent 7218788 commit b6303d2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
1 change: 0 additions & 1 deletion include/tig/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ struct view {
struct line *curline; /* Line currently being drawn. */
enum line_type curtype; /* Attribute currently used for drawing. */
unsigned long col; /* Column when drawing. */
bool has_scrolled; /* View was scrolled. */
bool force_redraw; /* Whether to force a redraw after reading. */

/* Loading */
Expand Down
41 changes: 0 additions & 41 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,6 @@ save_view(struct view *view, const char *path)
/* Whether or not the curses interface has been initialized. */
static bool cursed = false;

/* Terminal hacks and workarounds. */
static bool use_scroll_redrawwin;
static bool use_scroll_status_wclear;

/* The status window is used for polling keystrokes. */
WINDOW *status_win;

Expand All @@ -484,8 +480,6 @@ update_status_window(struct view *view, const char *context, const char *msg, va

if (!status_empty || *msg) {
wmove(status_win, 0, 0);
if (view && view->has_scrolled && use_scroll_status_wclear)
wclear(status_win);
if (*msg) {
vw_printw(status_win, msg, args);
status_empty = false;
Expand Down Expand Up @@ -637,7 +631,6 @@ void
init_display(void)
{
bool no_display = !!getenv("TIG_NO_DISPLAY");
const char *term;
int x, y;
int code;

Expand Down Expand Up @@ -691,36 +684,6 @@ init_display(void)
#else
TABSIZE = opt_tab_size;
#endif

term = getenv("XTERM_VERSION")
? NULL
: (getenv("TERM_PROGRAM") ? getenv("TERM_PROGRAM") : getenv("COLORTERM"));
if (term && !strcmp(term, "gnome-terminal")) {
/* In the gnome-terminal-emulator, the warning message
* shown when scrolling up one line while the cursor is
* on the first line followed by scrolling down one line
* corrupts the status line. This is fixed by calling
* wclear. */
use_scroll_status_wclear = true;
use_scroll_redrawwin = false;

} else if (term &&
(!strcmp(term, "xrvt-xpm") || !strcmp(term, "Apple_Terminal") ||
!strcmp(term, "iTerm.app"))) {
/* No problems with full optimizations in
* xrvt-(unicode)
* aterm
* Terminal.app
* iTerm2 */
use_scroll_status_wclear = use_scroll_redrawwin = false;

} else {
/* When scrolling in (u)xterm the last line in the
* scrolling direction will update slowly. This is
* the conservative default. */
use_scroll_redrawwin = true;
use_scroll_status_wclear = false;
}
}

static bool
Expand Down Expand Up @@ -785,10 +748,6 @@ update_views(void)

foreach_view (view, i) {
update_view(view);
if (view_is_displayed(view) && view->has_scrolled &&
use_scroll_redrawwin)
redrawwin(view->win);
view->has_scrolled = false;
if (view->pipe)
is_loading = true;
}
Expand Down
1 change: 0 additions & 1 deletion src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ do_scroll_view(struct view *view, int lines)
wnoutrefresh(view->win);
}

view->has_scrolled = true;
report_clear();
}

Expand Down

0 comments on commit b6303d2

Please sign in to comment.