terrygeng / termqt Goto Github PK
View Code? Open in Web Editor NEWA terminal emulator widget implemented in Python/Qt.
License: GNU Lesser General Public License v2.1
A terminal emulator widget implemented in Python/Qt.
License: GNU Lesser General Public License v2.1
I have used termqt in a tab inside a qdialog. whenever i reopen the dialog i use terminal.clear_buffer() to clear the screen but after some tries i get the following errors:
Traceback (most recent call last):
File ~/.local/lib/python3.8/site-packages/termqt/terminal_widget.py:658 in resize
self.resize(self.size().width(), self.size().height())
File ~/.local/lib/python3.8/site-packages/termqt/terminal_widget.py:451 in resize
self._save_cursor_state_stop_blinking()
File ~/.local/lib/python3.8/site-packages/termqt/terminal_widget.py:527 in _save_cursor_state_stop_blinking
self._switch_cursor_blink(CursorState.ON, False)
File ~/.local/lib/python3.8/site-packages/termqt/terminal_widget.py:522 in _switch_cursor_blink
self._paint_cursor()
File ~/.local/lib/python3.8/site-packages/termqt/terminal_widget.py:416 in _paint_cursor
c = self._buffer[ind_y][chr_x]
IndexError: deque index out of range
QPainter::begin: A paint device can only be painted by one painter at a time.
QPainter::setPen: Painter not active
QPainter::setFont: Painter not active
When resizing the window larger<>smaller a couple of times, this error gets thrown (reproducible on Windows):
[2023-05-09 20:24:38,544] > [terminal_buffer.py:717] screen: resize triggered, new size (99x31)
Traceback (most recent call last):
File "J:\Python\termqt\termqt\terminal_widget.py", line 152, in resizeEvent
self.resize(event.size().width(), event.size().height())
File "J:\Python\termqt\termqt\terminal_widget.py", line 298, in resize
self._restore_cursor_state()
File "J:\Python\termqt\termqt\terminal_widget.py", line 365, in _restore_cursor_state
self._switch_cursor_blink(self._cursor_blinking_state, True)
File "J:\Python\termqt\termqt\terminal_widget.py", line 356, in _switch_cursor_blink
self._paint_cursor()
File "J:\Python\termqt\termqt\terminal_widget.py", line 259, in _paint_cursor
qp.fillRect(x, y, cw, ch, bg)
TypeError: arguments did not match any overloaded call:
fillRect(self, QRectF, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'float'
fillRect(self, QRect, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'float'
fillRect(self, int, int, int, int, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'float'
fillRect(self, QRectF, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'float'
fillRect(self, QRect, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'float'
fillRect(self, int, int, int, int, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'float'
fillRect(self, int, int, int, int, Qt.GlobalColor): argument 1 has unexpected type 'float'
fillRect(self, QRect, Qt.GlobalColor): argument 1 has unexpected type 'float'
fillRect(self, QRectF, Qt.GlobalColor): argument 1 has unexpected type 'float'
fillRect(self, int, int, int, int, Qt.BrushStyle): argument 1 has unexpected type 'float'
fillRect(self, QRect, Qt.BrushStyle): argument 1 has unexpected type 'float'
fillRect(self, QRectF, Qt.BrushStyle): argument 1 has unexpected type 'float'
fillRect(self, int, int, int, int, QGradient.Preset): argument 1 has unexpected type 'float'
fillRect(self, QRect, QGradient.Preset): argument 1 has unexpected type 'float'
fillRect(self, QRectF, QGradient.Preset): argument 1 has unexpected type 'float'
Hi @TerryGeng ,
I got termqt
working on Windows using winpty:
Would you accept pull-requests for this upgrade?
when running a program it skips the first parameter, as a solution I pass the command as an array with first augment that is an empty string.
like:
[ cmd,"","arg1" ]
So, the code could be like:
cmd=shlex.split("text.exe arg1", posix=False)
cmd.insert(1,"")
terminal_io = TerminalWinptyIO(
terminal.row_len,
terminal.col_len,
cmd
)
terminal_io.spawn()
Salut, j'aimerais améliorer le projet si vous pouvez m'aider
I've been working on a Netbook user interface and I noticed that this project isn't available on pip which makes installing this package hard on multiple devices, so I was wondering if you have any plans to release this to PyPi?
The Terminal widget currently lacks a key feature, which is the ability to select text using the mouse for copying.
Hello,
I'm making this issue, although technically it's not an issue, but couldn't find another way to get in touch.
First of all, you can't imagine how glad I was to find this repo, as I've been searching for days something like this, although this did not show up until I included PyQt5 in my search query (I've only been searching for Qt, or PySide).
Anyhow, this repo does almost exactly what I need, but with a few subtle differences, and I wanted to chat about them before I just fork off and charge head down towards what I need, as maybe you'd like some to be contributed back, or some things may not work as I expect.
Thanks for your time!
Editing the line just entered has issue. inserting a character before "space" works like pressing "insert" key of the keyboard. For example enter "Hello World", place the cursor before the space, enter a character, press left arrow and again press a key. in normal mode inserting a char does not replace the character the cursor is on. but doing so, the mode suddenly changes
When resizing the termqt
window, the layout gets mangled when resizing back-and-forth from a larger to a smaller window. This problem is more prevalant on Windows as it seems that ConPTY
seems to work a bit weird.
Now this is not a termqt
specific problem, some other shells also have this problem (like zsh
, VSCode
's integrated terminal, Alacritty
, ...), but does anyone have any ideas on how to mitigate this?
Example with the current master
branch on Windows:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.