mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
On short prompts, commands wider than the terminal do not reposition to start on their own lines.
This commit is contained in:
parent
0a54558ee2
commit
2813dcc6cc
1 changed files with 8 additions and 1 deletions
|
@ -1215,7 +1215,14 @@ static screen_layout_t compute_layout(screen_t *s,
|
||||||
result.left_prompt_space = left_prompt_width;
|
result.left_prompt_space = left_prompt_width;
|
||||||
// See remark about for why we can't use the right prompt here
|
// See remark about for why we can't use the right prompt here
|
||||||
//result.right_prompt = right_prompt;
|
//result.right_prompt = right_prompt;
|
||||||
result.prompts_get_own_line = true;
|
|
||||||
|
// If the command wraps, and the prompt is not short, place the command on its own line.
|
||||||
|
// A short prompt is 33% or less of the terminal's width.
|
||||||
|
const size_t prompt_percent_width = (100 * left_prompt_width) / screen_width;
|
||||||
|
if (left_prompt_width + first_command_line_width + 1 > screen_width && prompt_percent_width > 33) {
|
||||||
|
result.prompts_get_own_line = true;
|
||||||
|
}
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue