Skip to content

Commit

Permalink
Ignore FOCUS_IN and FOCUS_OUT events if these have been activated wit…
Browse files Browse the repository at this point in the history
…hin xterm

Closes: htop-dev#1410
  • Loading branch information
Daniel Lange authored and Daniel Lange committed Mar 14, 2024
1 parent 53bd369 commit d558519
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CRT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,8 @@ IGNORE_WCASTQUAL_BEGIN
sequence[1] = c;
define_key(sequence, KEY_ALT('A' + (c - 'a')));
}
define_key("\033[I", KEY_FOCUS_IN);
define_key("\033[O", KEY_FOCUS_OUT);
#ifdef HTOP_NETBSD
IGNORE_WCASTQUAL_END
#undef define_key
Expand Down
2 changes: 2 additions & 0 deletions CRT.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ void CRT_handleSIGSEGV(int signal) ATTR_NORETURN;
#define KEY_RECLICK KEY_F(32)
#define KEY_SHIFT_TAB KEY_F(33)
#define KEY_ALT(x) (KEY_F(64 - 26) + ((x) - 'A'))
#define KEY_FOCUS_IN (KEY_MAX + 'I')
#define KEY_FOCUS_OUT (KEY_MAX + 'O')

extern const char* CRT_degreeSign;

Expand Down
3 changes: 3 additions & 0 deletions ScreenManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, con
ScreenManager_resize(this);
continue;
}
case KEY_FOCUS_IN:
case KEY_FOCUS_OUT:
break;
case KEY_LEFT:
case KEY_CTRL('B'):
if (this->panelCount < 2) {
Expand Down

0 comments on commit d558519

Please sign in to comment.