QEMU x86_64 -nographic full system breaks host Bash terminal line wrapping state after simulation ends, requires reset or "tput smam" to fix it

Bug #1857449 reported by Ciro Santilli 六四事件 法轮功
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Expired
Undecided
Unassigned

Bug Description

QEMU 4.2.0 compiled from source, Ubuntu 19.10, open a fresh new gnome terminal.

If you print 1000 = chars on the host terminal, then they do wrap around the end of the terminal:

printf "=%.0s" {0..1000}

However, if you first run QEMU:

x86_64-softmmu/qemu-system-x86_64 -nographic

and then quit it in any way, e.g. with Ctrl + A, and then re-run on the host terminal:

printf "=%.0s" {0..1000}

then the signs don't wrap around anymore, they just go "off the terminal to the right".

This can be fixed with either:

reset
tpam smam

but unfortunately those don't work in tmux for some reason: https://github.com/tmux/tmux/issues/969

I consider this buggy behavior, QEMU should restore the original terminal state if possible.

Related: https://github.com/cirosantilli/linux-kernel-module-cheat/issues/110

Revision history for this message
Philippe Mathieu-Daudé (philmd) wrote :

Apparently the code you run (BIOS?) is sending the DECRST control sequence to the terminal, which disable the auto-wrap mode flag.
Looking at the detailed explanations on https://github.com/mattiase/wraptest I'm not sure how QEMU can save/restore this flag.

Revision history for this message
Ciro Santilli 六四事件 法轮功 (cirosantilli) wrote :

Ah, thanks for looking into this and identifying it to guest code Philippe. I don't know much about terminals, but yes, they are such archaic interfaces, maybe there is no API for it :-(

Revision history for this message
Thomas Huth (th-huth) wrote :

The QEMU project is currently considering to move its bug tracking to
another system. For this we need to know which bugs are still valid
and which could be closed already. Thus we are setting older bugs to
"Incomplete" now.

If you still think this bug report here is valid, then please switch
the state back to "New" within the next 60 days, otherwise this report
will be marked as "Expired". Or please mark it as "Fix Released" if
the problem has been solved with a newer version of QEMU already.

Thank you and sorry for the inconvenience.

Changed in qemu:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.