Git Product home page Git Product logo

Comments (11)

TerryGeng avatar TerryGeng commented on May 27, 2024

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.

mohammadkarami2023 avatar mohammadkarami2023 commented on May 27, 2024

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.

mohammadkarami2023 avatar mohammadkarami2023 commented on May 27, 2024

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.

TerryGeng avatar TerryGeng commented on May 27, 2024

Great to know!

Thanks again!

from termqt.

TerryGeng avatar TerryGeng commented on May 27, 2024

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.

mohammadkarami2023 avatar mohammadkarami2023 commented on May 27, 2024

Thanks, another problem is with command top. the output not shows the apps running

from termqt.

mohammadkarami2023 avatar mohammadkarami2023 commented on May 27, 2024

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.

TerryGeng avatar TerryGeng commented on May 27, 2024

Why the foreground color is black in your case? I believe the default color is white. Can you investigate this?

from termqt.

mohammadkarami2023 avatar mohammadkarami2023 commented on May 27, 2024

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.

mohammadkarami2023 avatar mohammadkarami2023 commented on May 27, 2024

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
test
test1

from termqt.

TerryGeng avatar TerryGeng commented on May 27, 2024

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)

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.