Starship: Fish - On completion, the cursor is being moved left

Created on 4 Jun 2020  ยท  4Comments  ยท  Source: starship/starship

Current Behavior

  • Cursor is placed symbol on the left from position it was. The position is related to a number of languages added.

Gif record:
ezgif com-optimize(2)

Position of cursor before and after <TAB> for 3 loaded modules:

test on ๎‚  master [?] is ๐Ÿ“ฆ v0.4.3 via ๐Ÿ v2.7.16 via ๐ŸŒณ v0.19.1 โฏ git 
                                                                      ^
test on ๎‚  master [?] is ๐Ÿ“ฆ v0.4.3 via ๐Ÿ v2.7.16 via ๐ŸŒณ v0.19.1 โฏ git 
                                                                   ^

Expected Behavior

  • Cursor shouldn't move on tab completion

Additional context/Screenshots

  • It only happens when some language specific module is loaded (in current example, Elm)

Possible Solution

Environment

  • Starship version: 0.41.3
  • fish version: fish, version 3.1.2
  • Operating system: Mac OS 10.15.5
  • Terminal emulator: iTerm.app 3.3.9

Relevant Shell Configuration

set fish_greeting

function fish_right_prompt
  # intentionally left blank
end

starship init fish | source

source ~/.iterm2_shell_integration.fish

Starship Configuration

# Don't print a new line at the start of the prompt
add_newline = false
clear_before_printing = true
prompt_order=["username", "directory", "git_branch", "git_status", "package", "nodejs", "ruby", "rust", "python", "haskell", "elm", "golang", "cmd_duration", "jobs", "battery", "character",]

# Replace the "โฏ" symbol in the prompt with "โžœ"
[character]      # The name of the module we are confguring is "character"
#symbol = "โžœ"     # The "symbol" segment is being set to "โžœ"
error_symbol = "โœ—" # The symbol used before text input if the previous command failed
use_symbol_for_status = true # Indicate error status by changing the symbol

# Disables the line_break module, making the prompt a single line
[line_break]
disabled = true

๐Ÿ› bug

Most helpful comment

Looks like it happens for modules with emoji.
Can you please try running the following and seeing if it still happens:

set -g fish_emoji_width 2

All 4 comments

Whoa, that's weird.

We see this sort of issue in zsh/bash fairly regularly when we've screwed up color escapes somewhere, but I don't think we've seen it in fish before.

Do you know which languages/modules cause this? It would help a lot in hunting things down.

After some testing I found that for me it happening for the following modules: package, python, elm, golang.

The only module which didn't cause that: nodejs.

Looks like it happens for modules with emoji.
Can you please try running the following and seeing if it still happens:

set -g fish_emoji_width 2

@matchai Wow! Nice catch.

I can't reproduce the issue with setting non-emoji symbols for Python/Elm/etc, so it's definitely because of the emoji.

Looks like it has nothing to do with starship. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tlb42 picture tlb42  ยท  3Comments

teancom picture teancom  ยท  4Comments

olets picture olets  ยท  3Comments

matchai picture matchai  ยท  3Comments

Quantium picture Quantium  ยท  3Comments