Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fill adds one too many spaces on Windows Terminal when used with cmd_duration #5924

Open
matt-FFFFFF opened this issue Apr 10, 2024 · 1 comment
Labels
🐛 bug Something isn't working as expected.

Comments

@matt-FFFFFF
Copy link

matt-FFFFFF commented Apr 10, 2024

Bug Report

Current Behavior

Using fill with cmd_duration. Fill adds one too many spaces when the cmd_duration is formatted like this:

"[[](fg:#5C7F6A)⏱️ $duration[](fg:#5C7F6A)]($style)"

Expected Behavior

First line of prompt to be correctly padded by fill.

Additional context/Screenshots

Screenshot with default format vs. my custom format:

image

Note: Happens on Windows Terminal, does not happen on iTerm or Warp on MacOS

Possible Solution

Workaround is to add extra space to end of cmd_duration format string.

Environment

  • Starship version: [the output of starship --version]
❯  starship --version
starship 1.18.2
branch:master
commit_hash:
build_time:2024-03-29 15:44:42 +00:00
build_env:rustc 1.77.1 (7cf61ebde 2024-03-27),
  • Shell type: zsh
  • Shell version: zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
  • Shell plugin manager: n/a
  • Terminal emulator: Windows Terminal
  • Operating system: Ubuntu 22.04.3 LTS

Relevant Shell Configuration

# Your configuration here

Starship Configuration

# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'

format = """\
[](fg:#C2B4DF)\
$os\
$sudo\
$shell\
[](fg:#C2B4DF bg:#8A5A7F)\
$directory\
[](fg:#8A5A7F bg:#8AAE7F)\
$git_branch\
$git_commit\
$git_status\
$git_state\
[](fg:#8AAE7F bg:#FBF39F)\
($git_metrics)\
[](fg:#FBF39F)\
$fill\
$status\
$all\
$cmd_duration\
$line_break\
$character"""

# disabled due to fill module
# right_format = ''
add_newline = true

[line_break]
disabled = false

[fill]
symbol = ' '

[os]
disabled = false
format = '[$symbol]($style)'
style = "#C2B4DF inverted"

[os.symbols]
Macos = ""
Windows = ""
Ubuntu = ""

[sudo]
disabled = false
symbol = "🧙"
format = '[$symbol ]($style)'
style = "bg:#C2B4DF"

[shell]
disabled = false
zsh_indicator = ''
powershell_indicator = ''
style = 'fg:#C2B4DF inverted'
format = '[$indicator ]($style)'

[directory]
format = "[ \uf07c  $path ]($style)"
style = "fg:#E4E4E4 bg:#8A5A7F"

[git_branch]
format = '[ $symbol$branch(:$remote_branch) ]($style)'
symbol = "  "
style = "fg:#1C3A5E bg:#8AAE7F"

[git_status]
format = '([\[$all_status$ahead_behind\]]($style))'
style = "fg:#1C3A5E bg:#8AAE7F"

[git_commit]
disabled = false
format = '[\((#$hash)$tag\)]($style)'
tag_disabled = false
only_detached = true
style = "fg:#1C3A5E bg:#8AAE7F"

[git_metrics]
format = '([ +$added ]($added_style))([-$deleted ]($deleted_style))'
added_style = "fg:#1C3A5E bg:#FBF39F"
deleted_style = "fg:red bg:#FBF39F"
disabled = false

[cmd_duration]
disabled = false
format = "[[](fg:#5C7F6A)⏱️ $duration[](fg:#5C7F6A)]($style)"
style = "#5C7F6A inverted"

[character]
success_symbol = '[❯](bold #C2B4DF) '
error_symbol = '[❯](bold purple) '

[time]
disabled = true
time_format = "%R" # Hour:Minute Format
style = "bg:#1d2230"
format = '[[ 󱑍 $time ](bg:#1C3A5E fg:#8DFBD2)]($style)'

[azure]
disabled = false
format = '[](fg:#3376CD)[$symbol($subscription)]($style)[](fg:#3376CD)'
style = 'fg:#3376CD bold inverted'
symbol = '󰠅 '

[golang]
disabled = false
format = '[](fg:cyan)[$symbol($version )]($style)[](fg:cyan)'
style = 'fg:cyan inverted'
symbol = ''

[status]
disabled = false
symbol = '🔴 '
success_symbol = ''
format = '[$symbol( $common_meaning )$signal_name$maybe_int]($style) '
map_symbol = true

[terraform]
symbol = '󱁢 '
format = '[](fg:105)[$symbol$version( $workspace)]($style)[](fg:105)'
style = 'fg:105 inverted'
@matt-FFFFFF matt-FFFFFF added the 🐛 bug Something isn't working as expected. label Apr 10, 2024
@matt-FFFFFF matt-FFFFFF changed the title fill adds one too many spaces when used with cmd_duration fill adds one too many spaces on Windows Terminal when used with cmd_duration Apr 15, 2024
@DerRockWolf
Copy link

DerRockWolf commented May 12, 2024

From what I can tell this is unrelated to cmd_duration and also not only specific to the windows terminal.
I also experience the same issue with any module that I've changed to contain an emoji with the default gnome terminal and MesloLGS Nerd Font.

It happens when the prompt includes a symbol/emoji that consists of multiple UTF codepoints e.g., ❄️ (which is \U2744\UFE0F)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants