Empty line when opening terminal
Author: martensjostrandCreated Oct 18, 2019Updated Sep 1, 2026
Labels🐛 bug✅ existing workaround
Bug Report
Current Behavior
When add_line is enabled a new line is added at the beginning of every new terminal window/tab.
Expected Behavior
Using add_line should not add a new line above the first line of every window / tab.
Additional context/Screenshots
Environment
- Starship version: starship 0.25.0
- Shell type: zsh
- Shell version: zsh 5.3 (x86_64-apple-darwin18.0)
- Shell plugin manager: antibody
- Terminal emulator: iTerm2
- Operating system: OSX 10.14.6
Relevant Shell Configuration
eval "$(starship init zsh)"
source <(antibody init)
antibody bundle < ~/.zsh_plugins.txt
Starship Configuration
add_newline = true
Possible Solution
if config.add_newline {
writeln!(buf).unwrap();
}
The above if-statement from https://github.com/starship/starship/blob/master/src/print.rs#L23 could be changed into something inspired by Spaceship's solution: https://github.com/maximbaz/spaceship-prompt/commit/815b68c70f21c5512765c87985897b98b8ed232c found in https://github.com/denysdovhan/spaceship-prompt/issues/462
Source: starship/starship