extraterm icon indicating copy to clipboard operation
extraterm copied to clipboard

Unexpected framing behavior with loops or reset/clear command.

Open Kynolin opened this issue 6 years ago • 2 comments

I just want to add a couple of observations after using 0.46 with my modifications. This is while framing commands if output is longer than 1 line. Side note, that setting seems to frame commands if output is >= 1 line.

After running the clear command, my commands don't get framed initially, but after running additional commands with enough output to fill the screen, commands start being framed again. When my commands are being framed, reset doesn't clear the screen. It just goes to the next line like a command without output would. But, when I've got the framing issue after running clear, reset causes the clear command's full screen of blank output to display in a frame, then subsequent commands are framed successfully.

In fish, running a for loop to echo 1 through 5, with each number on a new line and a sleep after the echo, the output is displayed in-line as if it isn't going to be framed. It then gets removed and framed when the command finishes. On bash, 1-4 display in-line without a frame, then a frame is displayed containing only the number 5, with the previous non-framed lines still displayed. If you take away the sleep, fish frames all the output and bash doesn't display a frame. I first noticed this type of behavior running ssh-copy-id. Unlike the for loop with echo, both fish and bash display the ssh-copy-id output without a frame, then the text is removed and all output displays in one frame.

These were the commands I used:

for i in (seq 1 5); echo $i; sleep 1; end
for i in (seq 1 5); echo $i; end
for i in $(seq 1 5); do echo $i; sleep 1; done
for i in $(seq 1 5); do echo $i; done

Originally posted by @Kynolin in https://github.com/sedwards2009/extraterm/issues/225#issuecomment-545526918

Kynolin avatar Nov 23 '19 18:11 Kynolin

I originally thought this issue was mostly benign, but I've recently seen a condition that will cause the last line of output to not get framed if it doesn't end in a newline. This happens to me in both fish/bash on WSL in version 0.47.0. Output that is short enough to not get framed displays all the output with the return character at the end.

The example below is with "Frame command output if longer than" 3 lines.

image

Kynolin avatar Nov 23 '19 19:11 Kynolin

On version 0.49.0, I'm seeing better results with command output and framing behavior. The clear/reset commands seem to work fine now, and framing works immediately after running either command.

When the last line of output does not end with a newline character. The line always gets displayed now, which is much better, but the framing rules acts like the output was one line shorter, so it doesn't get framed.

For example, with the settings to frame longer than 3 lines, the fourth line won't get framed if it doesn't end with a newline, but it does get displayed. If it has a newline, it will be framed. If either are longer than four lines, they both get framed.

image

When set to frame longer than one line and running the for loops in the first comment, fish seems to work fine both ways, sleep or no sleep. Bash still doesn't frame either.

Kynolin avatar Jan 27 '20 17:01 Kynolin