mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-02-22 08:00:00 -05:00
Better terminal palette handling. Fixes #8.
This commit is contained in:
parent
4a935cb500
commit
4da00e57f3
@ -47,6 +47,14 @@ class NomadNetworkApp:
|
||||
except Exception as e:
|
||||
RNS.log("Could not restore flow control sequences. The contained exception was: "+str(e), RNS.LOG_WARNING)
|
||||
|
||||
if hasattr(self.ui, "restore_palette"):
|
||||
if self.ui.restore_palette:
|
||||
try:
|
||||
self.ui.screen.write("\x1b]104\x07")
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Could not restore terminal color palette. The contained exception was: "+str(e), RNS.LOG_WARNING)
|
||||
|
||||
RNS.log("Nomad Network Client exiting now", RNS.LOG_VERBOSE)
|
||||
|
||||
def exception_handler(self, e_type, e_value, e_traceback):
|
||||
|
@ -207,7 +207,10 @@ class TextUI:
|
||||
def set_colormode(self, colormode):
|
||||
self.colormode = colormode
|
||||
self.screen.set_terminal_properties(colormode)
|
||||
self.screen.reset_default_terminal_palette()
|
||||
|
||||
if self.colormode < 256:
|
||||
self.screen.reset_default_terminal_palette()
|
||||
self.restore_palette = True
|
||||
|
||||
def unhandled_input(self, key):
|
||||
if key == "ctrl q":
|
||||
|
Loading…
x
Reference in New Issue
Block a user