Skip to content

Empty line when opening terminal #560

Description

@martensjostrand

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

new-line

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:
max-baz/spaceship-prompt@815b68c found in spaceship-prompt/spaceship-prompt#462

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✅ existing workaroundWhen there is an unofficial way to solve an issue and there is no fix in starship yet.🐛 bugSomething isn't working as expected.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions