bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.16k stars 53 forks source link

[BUG] Window set_title does not set the title, but adds #111

Closed NicolaeBet closed 1 year ago

NicolaeBet commented 1 year ago

Describe the bug Window set_title does not set the title, but adds the title to the window instead.

To Reproduce Use window set_title more than once and notice that the window title, has in fact, been added to instead of changed.

Expected behavior I expect the window's title value to only change not ass

System information

PyTermGUI version 7.3.0

System details:
    Python version: 3.10.9
    $TERM:          xterm-kitty
    $COLORTERM:     truecolor
    Color support:  ColorSystem.TRUE
    OS Platform:    Linux-6.1.6-arch1-1-x86_64-with-glibc2.36

Possible cause Function for changing the window title might have a string manipulation error/mistake.

Possible solution Fix line 269 in window.py to be corners[position] = corners[corner] + text instead of corners[position] += text Note that the func _get_char could be a culprit in base.py Perhaps the _get_char "corner" part does not receive the corner but the set title instead? Changing the line to corners[position] = "╔" + title does work as a temporary fix for top left corner borders.

bczsalba commented 1 year ago

To be honest the whole system of setting titles has always been a bit of a mess, but it's impressive that I never noticed this part of it. I have some plans for the future that should eliminate this issue, with a new class replacing boxes. Will come back to update!

bczsalba commented 1 year ago

Sorry about the delay, this is fixed now!