I currently am launching a RISC-V qemu session as follows:
/usr/bin/qemu-system-riscv64 -machine virt -m 4G -smp cpus=2 -nographic \
-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.bin \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0 \
-drive file=qemu_disk.bin,format=raw,if=virtio \
-device virtio-rng-pci \
-vga virtio \
-no-reboot
The -vga virtio
in particular was necessary to get it to use the full terminal width at boot time, as shown below:
However, if I open an application like nano or gdb from within the qemu VM, it stops using the full width of the enclosing terminal window, as shown below:
How can I tell QEMU to behave as if it has more space, so that applications like nano and gdb recognize this when launched?
(Note: I subsequently found I can install the "resize" tool, and manually run it, but I'm wondering if there's a way to just have qemu handle this automatically.)
stty -a | grep -oP 'columns \K\d+'
return? What aboutecho $COLUMNS
?