Skip to content

Commit

Permalink
More CI fix-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbrittain committed Sep 17, 2023
1 parent 728cbe4 commit 63e1ec9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions asciimatics/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2380,10 +2380,13 @@ def __init__(self, win, height=None, catch_interrupt=False,

# Look for a mismatch between the kernel terminal and the terminfo
# database for backspace. Fix up keyboard mappings if needed.
kbs = curses.tigetstr("kbs").decode("utf-8")
tbs = termios.tcgetattr(sys.stdin)[6][termios.VERASE]
if tbs != kbs:
self._KEY_MAP[ord(tbs)] = Screen.KEY_BACK
try:
kbs = curses.tigetstr("kbs").decode("utf-8")
tbs = termios.tcgetattr(sys.stdin)[6][termios.VERASE]
if tbs != kbs:
self._KEY_MAP[ord(tbs)] = Screen.KEY_BACK
except termios.error:
pass

# Conversion from Screen attributes to curses equivalents.
self._ATTRIBUTES = {
Expand Down Expand Up @@ -2411,7 +2414,11 @@ def close(self, restore=True):
if restore:
self._screen.keypad(0)
curses.echo()
curses.nocbreak()
# Shouldn't fail on real systems. This code is for running tests in CI pipelines.
try:
curses.nocbreak()
except curses.error:
pass
curses.endwin()

@staticmethod
Expand Down

0 comments on commit 63e1ec9

Please sign in to comment.