Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line wrapping #5096

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Line wrapping #5096

wants to merge 2 commits into from

Conversation

Funami580
Copy link
Contributor

Fixes:

Not regressed:

  • Cursor wrapping in middle line: clear && echo -en "aaa\nbbbbbbbbbb\ncc\033[2;11H" && read
  • Wrapping line one time: clear && echo -n some long long text && read

Noteworthy:

  1. Fish disables it's own rewrapping mechanism for select terminals, such as Alacritty or Konsole.
    https://github.com/faho/fish-shell/blob/8c620cb5ccbf5955d6271fd3460c1f799d91abd1/share/functions/__fish_config_interactive.fish#L244-L262
    Since it doesn't do so for wezterm, line wrapping will have the usual issues just like with bash. But it's possible to test out what it would look like without their redrawing: KONSOLE_VERSION=210400 ./target/debug/wezterm -e fish
  2. Lines will still disappear in bash when resizing. Is there a way to disable bash's redrawing on resize?
  3. I haven't thoroughly tested this PR, and I wouldn't be surprised if it breaks (perhaps even a lot) of things

Open questions:

  1. See commit message of the second commit
  2. Is the approach with the set_edited for Cell actually fine?

I wouldn't be surprised if there are still changes needed for this PR to land. But right now, I don't feel like working on this PR anymore, and if there are still some things to do, anyone is free to take over this PR. Even if this PR doesn't land, it might serve as an inspiration for other line wrapping PRs.

This feels more like a workaround.
I would expect, that when a program prints exactly
as many chars as there a columns, the cursor would wrap
into the next line. This would be possible by putting
another "if self.wrap_next {" block after the for loop
in the performer. But it seems like there are programs
that depend on it not doing that, e.g. fish shell.
It prints a full line of mostly spaces and then does \r,
expecting the cursor is still on the same line.

This way, the cursor overflows into an extra column,
but I'm sure this has its own disadvantages. Perhaps
this commit should not be used at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant