qterminal
qterminal copied to clipboard
Greeting text from .bashrc is overwritten
Expected Behavior
Text should show completely
Current Behavior
Text is overwritten by prompt
Steps to Reproduce (for bugs)
put this in .bashrc
echo "--- Greetings, $USER"
echo "--- Your terminal size is: ${COLUMNS}x${LINES}"
(nothing else) start qterminal, then run the echo command again to see the difference
--- Greetings, root
root@indri:~# nal size is: 12x2
root@indri:~# echo "--- Your terminal size is: ${COLUMNS}x${LINES}"
--- Your terminal size is: 80x27
root@indri:~#
It works in gnome-terminal:
--- Greetings, root
--- Your terminal size is: 80x24
root@indri:~#
System Information
- QTerminal version: master
- Distribution & Version: Ubuntu indri
Cannot reproduce this neither in 1.0.0 neither in 0.17 (impish)
It just happens when i start a new qterminal, not with source I tested it with 0.14.1 0.17.0 1.0.0 on impish, 0.14.1 on focal (can't compile master there due to g++ too old, and qt too) What I do is start a qterminal, then start a new one by typing 'qterminal' Now I noticed that when i use the menu to start a new window/tab, it does show all lines Weird that it shows 12x2 first and then the right value with the echo command
Ok, I get
--- Greetings, stef
--- Your terminal size is: x
bash-5.1$
but only on the first tab, all the next ones are ok.
Ok, I get... but only on the first tab, all the next ones are ok.
Then we have a bug, probably in qtermwidget
.
I found out that it has to do with the font (Using Liberation Mono) size:
With 8pt i get --- Your terminal size is: 16x2
the line is overwritten
With 10pt i get --- Your terminal size is: 14x2
the line is overwritten
With 11pt i get --- Your terminal size is: 12x2
With 12pt i get --- Your terminal size is: x
and nothing is overwritten
(Using qtermwidget master too btw, and freetype + harfbuzz, but that didn't change a thing)
It seems that it has to do something with timing: On the 'direct, local' focal it happens less often. When i connect with ssh -X to it from another machine, and to the lxc ones, it happens all the time
Oh i found a workaround:
sleep .1
echo "--- Greetings, $USER"
echo "--- Your terminal size is: ${COLUMNS}x${LINES}"
With that sleep command added i don't get overwrites, and it shows the correct terminal size
QTerminal is too fast for me! ;-) Or is it qtermwidget? Is it really a bug now? Is it fixable?
Is it really a bug now?
Yes, it is.
Is it fixable?
It should be, if we find where it happens.