Git Product home page Git Product logo

termqt's People

Contributors

herronelou avatar matkuki avatar shimondoodkin avatar spchamp avatar terrygeng avatar tizbac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

termqt's Issues

Extremely slow rendering

Hi,

Running commands with a small amount of output is not a problem, but larger output severely slows down the rendering, here is an example:
explorer_ow5YlrgVtD
The second choco -? command is extremely slow.

Any simple ways to speed this up? Thanks

an issue with clear buffer

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

Resizing crashes

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'

an issue with winpty. it is missing first argument - workaround

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()

Any plans to release TermQT on PyPi?

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?

PySide2 version + integration with QProcess.

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.

  1. Dependency on PyQt5 is sadly a no go for me, as the application needs to run in a PySide2 environment. I've been using Qt.py almost exclusively for all Qt dev, as it supports PyQt4, PyQt5, PySide and PySide2 (Qt6 is a looming question, but I'm trying to ignore it for now). I don't foresee any hurdles converting your code to Qt.py, as I've done dozens of libraries and almost never hit a road block.
  2. I have been using a very rudimentary Qt Console made of a QTextEdit for some applications, which did the trick until recently. In most cases, it has been used to "observe" remotely running processes. Basically a display of the stdout/stderr without the ability for the user to really control anything, as these are long running processes running on VMs . Long story short some running processes are outputting ANSI codes which has messed up my simple console as it had no ANSI support, and trying to implement it cleanly has proved challenging, which has sent me on my search for alternatives and/or examples I could follow. One thing I worry about is possibly the inability to control the number of columns, as in my uses cases the communication is happening one way only (from the remote console to the local "display") and there may even be multiple users monitoring the same process. The QTextEdit console was not using columns, and I wonder if that may have contributed to some of the difficulties I've encountered trying to implement ANSI cursor movements. With your expertise in the subject, do you foresee any roadblocks in adopting your widget knowing that I only receive strings via signals and can't communicate back?
  3. Sadly I need to backport to python 2.7 as well as we have some dependency on commercial software that hasn't been fully phased out yet, but that I'm happy to just do as a different branch or something, I don't think your project would necessarily benefit from it, and we're in fact also working hard to get rid of it.

Thanks for your time!

Editing command

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

Layout mangling when resizing

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:
explorer_RFQPmxpEw4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.