nushell / nushell/reedline

nu doesn't handle resizing intelligently

Open
#477 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Display A-Prompt bug
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

Describe the bug

It seems that removing smart resize handling (#6016) actually results in an experience different than some terminals, and one that I'd argue is worse.

See, for example, this comparison with fish (fish bottom, nu top):

20220912_11h46m30s_grim
20220912_11h46m22s_grim
20220912_11h46m05s_grim

All I do here is just resize the terminal by dragging the edge -- fish is able to handle this correctly, and keep the right prompt on the right, but nu is not.

This becomes an especially egregious problem when you're using a window manager that always sends at least one resize event on launch n(like Sway). In that case, opening the terminal for the first time always results in an annoying, misplaced right prompt, and for some reason typing a command places the prompt in the middle of the screen, which I'd say makes it nigh-unusable.

image

How to reproduce

To be very annoyed, use a window manager like Sway, or to be mildly annoyed, just try resizing while having a right prompt.

Expected behavior

Right prompt will stick to the right of the screen, and will be in the correct place initially.

Configuration
key value
version 0.68.1
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.65.0-nightly (59e7a308e 2022-09-11)
rust_channel nightly-x86_64-unknown-linux-gnu
cargo_version cargo 1.65.0-nightly (646e9a0b9 2022-09-02)
pkg_version 0.68.1
build_time 2022-09-12 10:00:42 -04:00
build_rust_channel release
features default, trash, which, zip
installed_plugins

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how terminal resize events update the right-prompt layout, with particular attention to the behavior removed in #6016. Reproduce the issue by resizing a prompt manually or launching under Sway, then verify that the right prompt stays aligned initially and after resizing without disrupting command entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.