Comments (11)
This is a good catch. paint_cursor
doesn't check if the cursor is in the valid buffer region. I posted a quick fix #27. Would you please confirm it solves this bug?
On the other hand, I would suggest you reset the cursor position to (0, 0) after clearing the buffer to avoid the cursor position surprising you.
from termqt.
thanks, clear buffer now works. another issue happens when the initial command fails. i get the following:
Traceback (most recent call last):
File ~/.local/lib/python3.8/site-packages/termqt/terminal_widget.py:545 in _stdout
need_draw = self._stdout_string(string)
File ~/.local/lib/python3.8/site-packages/termqt/terminal_buffer.py:1378 in _stdout_string
self.write_at_cursor(tst_buf)
File ~/.local/lib/python3.8/site-packages/termqt/terminal_buffer.py:1051 in write_at_cursor
self.write(text, pos=None, set_cursor=True, reset_offset=False)
File ~/.local/lib/python3.8/site-packages/termqt/terminal_buffer.py:1027 in write
buf[pos_y][pos_x] = t
IndexError: list assignment index out of range
from termqt.
I also modified the last lines of start.py to test the functionality of clear_buffer. no exceptions happens but in the terminal the current dir is shown twice.
terminal_io.stdout_callback = terminal.stdout
terminal.stdin_callback = terminal_io.write
terminal.resize_callback = terminal_io.resize
terminal_io.spawn()
terminal.clear_buffer()
terminal_io.terminate()
terminal_io.spawn()
terminal.set_cursor_position(0, 0)
terminal.clear_buffer()
terminal.set_cursor_position(0, 0)
sys.exit(app.exec())
Terminal looks like
mohammad@mypc:~/Downloads/termqt-240fda2253750944cc922b329ce2d72318de1b78$mohammad@mypc:~/Downloads/termqt-240fda2253750944cc922b329ce2d72318de1b78$
from termqt.
Great to know!
Thanks again!
from termqt.
Regarding the new issue of lines being displayed twice, I would think it is an issue with the shell itself (since the shell doesn't know the buffer is cleared). I may look into it a bit more today.
from termqt.
Thanks, another problem is with command top. the output not shows the apps running
from termqt.
oh i realized that there is no problem with command top but the font is black similar to the background.
also is there anyway to change the background of the widget?
from termqt.
Why the foreground color is black in your case? I believe the default color is white. Can you investigate this?
from termqt.
my foreground is white. when i execute top command in the bash, the summary of my resources are shown as white, but the processes have black font color
from termqt.
it seems that the lines that get updated have black foreground color. in my case even the upper lines after a while become black as shown in the following pictures
from termqt.
I see. The issue is caused by the broken support for some escape sequences. I have pushed a new commit to #27. Would you have a look?
from termqt.
Related Issues (14)
- Any plans to release TermQT on PyPi? HOT 10
- Open to pull-requests? HOT 2
- Extremely slow rendering HOT 7
- Resizing crashes HOT 3
- Layout mangling when resizing HOT 5
- PySide2 version + integration with QProcess. HOT 19
- Amelioration de Termqt HOT 2
- some font have different charwidth HOT 1
- Add support for text selection HOT 3
- Vertical resizing: Text not anchored to the top. HOT 1
- an issue with winpty. it is missing first argument - workaround
- Editing command HOT 5
- Support for [4h and [4l escape sequences HOT 1
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 termqt.