Commit 116c167e authored by mathieui's avatar mathieui

fix: allow certificate confirm dialog resize

fixes #3371
parent 11de2d98
Pipeline #3908 passed with stages
in 6 minutes and 24 seconds
...@@ -617,7 +617,7 @@ class Core: ...@@ -617,7 +617,7 @@ class Core:
pass pass
sys.__excepthook__(typ, value, trace) sys.__excepthook__(typ, value, trace)
def sigwinch_handler(self): def sigwinch_handler(self, *args):
"""A work-around for ncurses resize stuff, which sucks. Normally, ncurses """A work-around for ncurses resize stuff, which sucks. Normally, ncurses
catches SIGWINCH itself. In its signal handler, it updates the catches SIGWINCH itself. In its signal handler, it updates the
windows structures (for example the size, etc) and it windows structures (for example the size, etc) and it
......
...@@ -10,6 +10,7 @@ import asyncio ...@@ -10,6 +10,7 @@ import asyncio
import curses import curses
import functools import functools
import select import select
import signal
import ssl import ssl
import sys import sys
import time import time
...@@ -1463,11 +1464,16 @@ class HandlerCore: ...@@ -1463,11 +1464,16 @@ class HandlerCore:
self.core.add_tab(confirm_tab, True) self.core.add_tab(confirm_tab, True)
self.core.doupdate() self.core.doupdate()
# handle resize
prev_value = signal.signal(signal.SIGWINCH, self.core.sigwinch_handler)
while not confirm_tab.done: while not confirm_tab.done:
sel = select.select([sys.stdin], [], [], 5)[0] try:
sel = select.select([sys.stdin], [], [], 0.5)[0]
if sel: if sel:
self.core.on_input_readable() self.core.on_input_readable()
except:
continue
signal.signal(signal.SIGWINCH, prev_value)
def validate_ssl(self, pem): def validate_ssl(self, pem):
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment