-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple instances when opening and closing a file #10
Comments
Silly of me running another subprocess on top of another thinking that the first one would had been terminated somehow (or whatever the fuck i was thinking that time). IssueIt's more of a "how to restore the terminal after opening&closing a subprocess" issue rather than anything else. Somehow after such a sequence (of opening&closing) things can get messed up, especially keys and the mode of terminal [...] A potential solutionA temporary but also potential solution could be os.exec*() |
Actually this line |
Also just a reminder to add if unicurses.OPERATING_SYSTEM != 'Windows':
os.system('stty sane') Or something like that anyways |
I just found out that import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__)))) |
Here another very intresting solution i found out: @staticmethod
@contextmanager
def suspend():
"""
Suspend curses in order to open another subprocess in the terminal.
"""
try:
curses.endwin()
yield
finally:
curses.doupdate() def open(...):
...
if open_with:
with self.suspend():
os.system('clear')
proc = subprocess.Popen([open_with, directory])
proc.wait() Althought I've no idea of how it works |
https://github.com/GiorgosXou/TUIFIManager/blob/19487a82f9c42152b46c58e2a04a942585533eda/TUIFIManager/__init__.py#L255/
The text was updated successfully, but these errors were encountered: