Skip to content

Misplaced cmdline after terminal resize #7978

@jrmd54

Description

@jrmd54

Describe the bug
The bug occurs when the terminal has been resized while an application is open in it (for example, nano or vim).
Exiting the application will cause the cmdline to appear in the middle of previously typed commands, instead of starting after the last command.

To Reproduce
These steps were reproduced without a .bashrc and with the default gnome desktop manager.

kitty -c NONE
# Fill the screen with text to be able to reproduce issue, open text file with nano
cat /usr/bin/ls && nano /usr/bin/ls
# Shrink size of term (only by width), exit nano with ctrl-x
# The current cmdline is overlapping the previous command and overwriting it

Bug reproduction may be affected by initial size of the terminal.
Sometimes the cmdline is not just misplaced on the previous command, but in the middle of the screen.

Video
https://github.com/user-attachments/assets/a1c95a2d-e219-43d5-b987-83fdc3382703

Environment details

kitty 0.36.4 (c127517c96) created by Kovid Goyal
Linux jrmd54-XPS-15-9520 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun  7 15:10:09 UTC 2024 x86_64
Ubuntu 23.10 jrmd54-XPS-15-9520 /dev/tty

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=23.10
DISTRIB_CODENAME=mantic
DISTRIB_DESCRIPTION="Ubuntu 23.10"
Running under: X11
OpenGL: '4.6 (Core Profile) Mesa 23.2.1-1ubuntu3.1' Detected version: 4.6
Frozen: True
Fonts:
  medium: DejaVuSansMono: /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:0
          Features: ()
    bold: DejaVuSansMono-Bold: /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf:0
          Features: ()
  italic: DejaVuSansMono-Oblique: /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf:0
          Features: ()
      bi: DejaVuSansMono-BoldOblique: /usr/share/fonts/truetype/dejavu/DejaVuSansMono-BoldOblique.ttf:0
          Features: ()
Paths:
  kitty: /home/jrmd54/.local/kitty.app/bin/kitty
  base dir: /home/jrmd54/.local/kitty.app/lib/kitty
  extensions dir: /home/jrmd54/.local/kitty.app/lib/kitty-extensions
  system shell: /bin/bash

Config options different from defaults:

Important environment variables seen by the kitty process:
	PATH                                /home/jrmd54/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
	LANG                                en_US.UTF-8
	SHELL                               /bin/bash
	DISPLAY                             :1
	USER                                jrmd54
	XDG_CONFIG_DIRS                     /etc/xdg/xdg-ubuntu:/etc/xdg
	XDG_MENU_PREFIX                     gnome-
	LC_ADDRESS                          fr_FR.UTF-8
	LC_NAME                             fr_FR.UTF-8
	LC_MONETARY                         fr_FR.UTF-8
	XDG_SESSION_DESKTOP                 ubuntu
	XDG_SESSION_TYPE                    x11
	LC_PAPER                            fr_FR.UTF-8
	XDG_CURRENT_DESKTOP                 ubuntu:GNOME
	XDG_SESSION_CLASS                   user
	LC_IDENTIFICATION                   fr_FR.UTF-8
	LC_TELEPHONE                        fr_FR.UTF-8
	LC_MEASUREMENT                      fr_FR.UTF-8
	XDG_RUNTIME_DIR                     /run/user/1000
	LC_TIME                             fr_FR.UTF-8
	XDG_DATA_DIRS                       /usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
	LC_NUMERIC                          fr_FR.UTF-8

Additional context
Command lines that are overwritten when this bug occurs are also overwritten in the scrollback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions