qterminal icon indicating copy to clipboard operation
qterminal copied to clipboard

Greeting text from .bashrc is overwritten

Open z0rti opened this issue 3 years ago • 6 comments

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

z0rti avatar Feb 02 '22 20:02 z0rti

schermata-02-02-21-32

Cannot reproduce this neither in 1.0.0 neither in 0.17 (impish)

stefonarch avatar Feb 02 '22 20:02 stefonarch

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

z0rti avatar Feb 03 '22 21:02 z0rti

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.

stefonarch avatar Feb 03 '22 21:02 stefonarch

Ok, I get... but only on the first tab, all the next ones are ok.

Then we have a bug, probably in qtermwidget.

tsujan avatar Feb 03 '22 21:02 tsujan

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?

z0rti avatar Feb 05 '22 23:02 z0rti

Is it really a bug now?

Yes, it is.

Is it fixable?

It should be, if we find where it happens.

tsujan avatar Feb 06 '22 02:02 tsujan