mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-25 14:51:15 -03:00
Refresh winsize before printing prompt
This allows prompts to react to $COLUMNS by e.g. omitting some parts. We still fallback to a ">" prompt if that's still not short enough, but now the user has a way of making a nicer prompt. Fixes #904. Fixes #4381.
This commit is contained in:
@@ -711,6 +711,10 @@ static void exec_prompt() {
|
||||
// Do not allow the exit status of the prompts to leak through.
|
||||
const bool apply_exit_status = false;
|
||||
|
||||
// HACK: Query winsize again because it might have changed.
|
||||
// This allows prompts to react to $COLUMNS.
|
||||
(void) get_current_winsize();
|
||||
|
||||
// If we have any prompts, they must be run non-interactively.
|
||||
if (data->left_prompt.size() || data->right_prompt.size()) {
|
||||
proc_push_interactive(0);
|
||||
|
||||
Reference in New Issue
Block a user