Comments (6)
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).
Issue
It'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 solution
A temporary but also potential solution could be os.exec*()
from tuifimanager.
Yep, so far (the temp solution) works as expected
(Image: termux)
from tuifimanager.
Actually this line os.execl(sys.argv[0], sys.argv[0], self.directory)
does the job (I'm not sure why sys.argv[0]
needs to be pressent 2 times)
from tuifimanager.
Also just a reminder to add
if unicurses.OPERATING_SYSTEM != 'Windows':
os.system('stty sane')
Or something like that anyways
from tuifimanager.
I just found out that os.execl(sys.argv[0], sys.argv[0], self.directory)
works only if pip3 install .
the setup.py
and not if I just run python3 ...\__main__.py
with:
import sys
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from tuifimanager.
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
from tuifimanager.
Related Issues (20)
- Scroll sensitivity HOT 1
- Code Formatting HOT 14
- Typing support HOT 1
- Using a static configuration for the setup process HOT 1
- FIle formats not supported HOT 4
- Display Hidden files after Non-Hidden files HOT 1
- Issue initializing colors on Windows
- Scroll wheel not working on Windows HOT 1
- Error when starting tuifi HOT 2
- Add a nox ci for various configuration
- Hover Effect on Windows HOT 4
- Yank when no file selected
- Flickering of menu (?) HOT 27
- Installation with pip is giving an error on pyproject.toml: LICENSE not found. HOT 5
- Oopsie, version
- What's wrong with Popen in Windows?
- Nix OS support
- Git keeps corrupting the peek gif
- TUItilities - Multiline Label resize artifacts HOT 3
- Ideas and features HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuifimanager.