contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.3k stars 100 forks source link

Another rendering glitch when using shell history editing features #1512

Closed herrhotzenplotz closed 1 month ago

herrhotzenplotz commented 1 month ago

This time I am using /bin/sh from FreeBSD. Nothing customised.

$ git show
commit 121d7ade938ac99a18ff0b4f650254778baddafd
Merge: 2aa9cac7 ab89e100
Author: Christian Parpart <christian@parpart.family>
Date:   Mon May 27 22:22:04 2024 +0200

    Merge pull request #1505 from contour-terminal/improvement/new_ubuntu_version

    Add Ubuntu 24.04 to github actions

$ uname -a
FreeBSD triton 14.0-RELEASE-p6 FreeBSD 14.0-RELEASE-p6 #1 fix/sennheiser-bt-headphones-n265422-d85cb6d31f13: Wed Apr 10 11:32:35 CEST 2024     root@triton:/usr/obj/usr/src/amd64.amd64/sys/TRITON140RACK amd64
$ freebsd-version
14.0-RELEASE-p6
$

I did the following:

Note that the f from foobar gets pushed forward and everything following is being corrupted. This should not happen.

Debug log:

$ contour debug "pty.*,vt.trace.sequence"
Warning: qrc:/contour/ui/Terminal.qml:14:12: Duplicate signal name: invalid override of property change signal or superclass signal (qrc:/contour/ui/Terminal.qml:14, (null))
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
Warning: Invalid audio device ((null):0, (null))
Warning: Failed to create a gst element for the audio device, using a default audio sink ((null):0, (null))
[2024-05-28 18:39:40.251207.251207] [pty.input] master received: "$ "
[2024-05-28 18:39:40.251297.251296] [vt.trace.sequence] [primary] text: (2 bytes, 2 cells): "$ "
[2024-05-28 18:39:40.768770.768770] [pty.output] Sending bytes: "d"
[2024-05-28 18:39:40.768817.768816] [pty.input] master received: "d"
[2024-05-28 18:39:40.915618.915618] [pty.output] Sending bytes: "r"
[2024-05-28 18:39:40.915657.915656] [pty.input] master received: "r"
[2024-05-28 18:39:41.078767.078767] [pty.output] Sending bytes: "i"
[2024-05-28 18:39:41.078805.078805] [pty.input] master received: "i"
[2024-05-28 18:39:41.253668.253668] [pty.output] Sending bytes: "l"
[2024-05-28 18:39:41.253709.253709] [pty.input] master received: "l"
[2024-05-28 18:39:41.452840.452840] [pty.output] Sending bytes: "l"
[2024-05-28 18:39:41.452882.452882] [pty.input] master received: "l"
[2024-05-28 18:39:41.840928.840928] [pty.output] Sending bytes: " "
[2024-05-28 18:39:41.840975.840975] [pty.input] master received: " "
[2024-05-28 18:39:42.740956.740956] [pty.output] Sending bytes: "f"
[2024-05-28 18:39:42.740991.740991] [pty.input] master received: "f"
[2024-05-28 18:39:42.849946.849946] [pty.output] Sending bytes: "o"
[2024-05-28 18:39:42.849983.849983] [pty.input] master received: "o"
[2024-05-28 18:39:43.017900.017900] [pty.output] Sending bytes: "o"
[2024-05-28 18:39:43.017933.017932] [pty.input] master received: "o"
[2024-05-28 18:39:43.378080.378080] [pty.output] Sending bytes: "b"
[2024-05-28 18:39:43.378122.378121] [pty.input] master received: "b"
[2024-05-28 18:39:43.500999.500999] [pty.output] Sending bytes: "a"
[2024-05-28 18:39:43.501035.501035] [pty.input] master received: "a"
[2024-05-28 18:39:43.725034.725034] [pty.output] Sending bytes: "r"
[2024-05-28 18:39:43.725056.725056] [pty.input] master received: "r"
[2024-05-28 18:39:44.159084.159084] [pty.output] Sending bytes: "\eb"
[2024-05-28 18:39:44.159179.159179] [pty.input] master received: "\e[6D"
[2024-05-28 18:39:44.159188.159188] [vt.trace.sequence] text: "drill foobar"
[2024-05-28 18:39:44.159206.159206] [vt.trace.sequence] Processing CUB            CSI 6 D
[2024-05-28 18:39:44.481126.481126] [pty.output] Sending bytes: "-"
[2024-05-28 18:39:44.481179.481179] [pty.input] master received: "\r\e[8C\e[4h-\e[4lf\x08"
[2024-05-28 18:39:44.481198.481198] [vt.trace.sequence] control U+0D (Carriage Return)
[2024-05-28 18:39:44.481208.481208] [vt.trace.sequence] Processing CUF            CSI 8 C
[2024-05-28 18:39:44.481213.481213] [vt.trace.sequence] Processing SM             CSI 4 h
[2024-05-28 18:39:44.481219.481219] [vt.trace.sequence] text: "-"
[2024-05-28 18:39:44.481222.481222] [vt.trace.sequence] Processing RM             CSI 4 l
[2024-05-28 18:39:44.481225.481225] [vt.trace.sequence] control U+08 (Backspace)
[2024-05-28 18:39:44.651036.651036] [pty.output] Sending bytes: "x"
[2024-05-28 18:39:44.651089.651089] [pty.input] master received: "\r\e[9C\e[4hx\e[4lf\x08"
[2024-05-28 18:39:44.651108.651108] [vt.trace.sequence] control U+0D (Carriage Return)
[2024-05-28 18:39:44.651111.651111] [vt.trace.sequence] text: "f"
[2024-05-28 18:39:44.651120.651120] [vt.trace.sequence] Processing CUF            CSI 9 C
[2024-05-28 18:39:44.651125.651125] [vt.trace.sequence] Processing SM             CSI 4 h
[2024-05-28 18:39:44.651130.651130] [vt.trace.sequence] text: "x"
[2024-05-28 18:39:44.651133.651133] [vt.trace.sequence] Processing RM             CSI 4 l
[2024-05-28 18:39:44.651137.651136] [vt.trace.sequence] control U+08 (Backspace)
[2024-05-28 18:39:44.794046.794046] [pty.output] Sending bytes: " "
[2024-05-28 18:39:44.794121.794120] [pty.input] master received: "\r\e[10C\e[4h \e[4lf\x08"
[2024-05-28 18:39:44.794128.794128] [vt.trace.sequence] control U+0D (Carriage Return)
[2024-05-28 18:39:44.794131.794131] [vt.trace.sequence] text: "f"
[2024-05-28 18:39:44.794139.794139] [vt.trace.sequence] Processing CUF            CSI 10 C
[2024-05-28 18:39:44.794144.794144] [vt.trace.sequence] Processing SM             CSI 4 h
[2024-05-28 18:39:44.794148.794148] [vt.trace.sequence] text: " "
[2024-05-28 18:39:44.794152.794152] [vt.trace.sequence] Processing RM             CSI 4 l
[2024-05-28 18:39:44.794155.794155] [vt.trace.sequence] control U+08 (Backspace)
[2024-05-28 18:39:46.805353.805352] [pty.output] Sending bytes: "\x03"
[2024-05-28 18:39:46.805397.805397] [pty.input] master received: "\r\n"
[2024-05-28 18:39:46.805417.805417] [vt.trace.sequence] control U+0D (Carriage Return)
[2024-05-28 18:39:46.805421.805421] [vt.trace.sequence] control U+0A (Line Feed)
[2024-05-28 18:39:46.805434.805434] [pty.input] master received: "$ "
[2024-05-28 18:39:46.805439.805439] [vt.trace.sequence] [primary] text: (2 bytes, 2 cells): "$ "
[2024-05-28 18:39:47.960555.960555] [pty.output] Sending bytes: "\x0c"
[2024-05-28 18:39:47.960594.960594] [pty.input] master received: "\e[H\e[2J$ "
[2024-05-28 18:39:47.960608.960608] [vt.trace.sequence] text: "f"
[2024-05-28 18:39:47.960617.960617] [vt.trace.sequence] Processing CUP            CSI H
[2024-05-28 18:39:47.960624.960624] [vt.trace.sequence] Processing ED             CSI 2 J
[2024-05-28 18:39:47.960638.960638] [vt.trace.sequence] [primary] text: (2 bytes, 2 cells): "$ "
[2024-05-28 18:39:49.684887.684887] [pty.output] Sending bytes: "\x04"
[2024-05-28 18:39:49.684926.684926] [pty.input] master received: "^D"
[2024-05-28 18:39:49.684955.684955] [pty.input] master received: "\r\n"
[2024-05-28 18:39:49.684962.684962] [vt.trace.sequence] control U+0D (Carriage Return)
[2024-05-28 18:39:49.684965.684965] [vt.trace.sequence] control U+0A (Line Feed)
[2024-05-28 18:39:49.684974.684974] [pty.input] stdout-fastpipe received: ""
[2024-05-28 18:39:49.684977.684977] [pty.input] Closing stdout-fastpipe.
[2024-05-28 18:39:49.685000.685000] [pty.input] master received: ""
Debug[qml]: Client process terminated. Closing the window. (qrc:/contour/ui/Terminal.qml:184, expression for onTerminated)
Debug[qml]: Client process terminated. Closing the window. (qrc:/contour/ui/Terminal.qml:184, expression for onTerminated)

Reproducing this should be straight forward by sshing from contour into a FreeBSD VM (or bare metal machine for that matter) and following the steps to reproduce.

herrhotzenplotz commented 1 month ago

Pardon me, I might have messed something up here. I'll report back once I figured out what is going on.

herrhotzenplotz commented 1 month ago

Turns out that I confused some versions on my system (classic...). This bug appears in the latest release but not on master. However, I can't seem to find which commit in particular it was fixed in. I haven't bisected the problem but looking at the commit messages I am unsure. Closing this as not being a bug anymore. Sorry for the noise.

Yaraslaut commented 1 month ago

Turns out that I confused some versions on my system (classic...). This bug appears in the latest release but not on master. However, I can't seem to find which commit in particular it was fixed in. I haven't bisected the problem but looking at the commit messages I am unsure. Closing this as not being a bug anymore. Sorry for the noise.

No worriers :) thanks for bug reports, otherwise we might miss some important bugs especially on FreeBSD

herrhotzenplotz commented 1 month ago

Turns out that I confused some versions on my system (classic...). This bug appears in the latest release but not on master. However, I can't seem to find which commit in particular it was fixed in. I haven't bisected the problem but looking at the commit messages I am unsure. Closing this as not being a bug anymore. Sorry for the noise.

No worriers :) thanks for bug reports, otherwise we might miss some important bugs especially on FreeBSD

On that note: With some pain and suffering I have revived the FreeBSD port of contour: https://github.com/herrhotzenplotz/ports-overlay/tree/master/x11/contour ... when given enough testing and patches for the bugs like this one I will get it submitted to the ports tree such that it will become an official binary package for FreeBSD. Build log can be found here

herrhotzenplotz commented 1 month ago

After bisecting this, the bug is fixed by b328cdbab0526dd76900468a7c09547ffda487d8