sedwards2009 / extraterm

The swiss army chainsaw of terminal emulators
https://extraterm.org
MIT License
2.51k stars 116 forks source link

Framing incompatible with multi-line prompts #349

Open mtalexan opened 3 years ago

mtalexan commented 3 years ago

Problem

Multi-line prompts are common among the target Linux-user audience, but are not handled properly with Frames.

Especially with zsh, prompts that have the text entry on a line following one or more informational lines are common. Examples include various powerlevel4k, 9k, and 10k themes, and the less-common "garrett" theme shown in the example below. With Frames enabled and the zsh setup sourced, the lines up to the one for actual entry are included in the prior frame.

Example: extraterm_frame_prompt_bug

Possible Solution Allow a value to be specified for the number of trailing lines of "output" that should be excluded from Frames. Output being considered for frames should have this number subtracted from it (accounting for accidental negative numbers) before checking to see if it meets the requirement for the number of lines to trigger framing. When framing is triggered, the indicated number of trailing lines should be excluded from the frame.

Given the example shown above, this number would probably be set to 2 since the prompt is currently configured to insert a blank line before the information line, then the information line, then the line for input. Alternatively it could be set to 1, so a blank line appears as the last line of each of the frames.