nushell / nushell/reedline

Recreate and Redraw Prompt on resize

Open
#938 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Platform: Arch linux
Terminal software: Ghostty

def prompt [] {
	print 'test'
	let w = term size | get columns
	let bar = seq 1 ($w) | each {'-'} | str join
	$"($bar)\n"
}

$env.PROMPT_COMMAND = {|| prompt}

I am using this script to simplify testing.
in my real prompt (configured with starship) I have a 'fill' section which fills all the mid space.

my understanding is that on resize the closure assigned will not rerun to calculate the new width of the bar, instead the first prompt is cached and only redrawn on the terminal.

is there a way to rerun the closure instead to have the fill section shrink on resize.

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

Reproduce the resize behavior with the supplied prompt closure on Arch Linux and Ghostty, then inspect Reedline's prompt rendering and terminal-resize handling. Done means the prompt closure reruns after resizing so the bar or Starship fill section reflects the new terminal width, with no stale cached prompt remaining.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
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.