Skip to content

Recreate and Redraw Prompt on resize #938

@Ezall2001

Description

@Ezall2001

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions