Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Tab completion deletes prompt character #179

Closed
pikeas opened this issue Apr 1, 2019 · 5 comments
Closed

Tab completion deletes prompt character #179

pikeas opened this issue Apr 1, 2019 · 5 comments
Labels
Type: Bug Fix an existing bug

Comments

@pikeas
Copy link

pikeas commented Apr 1, 2019

Bug Report

Current Behavior
When pressing <tab> to trigger shell completion, the character under the cursor (whether part of the prompt or typed by the user) is deleted.

Here are before/after images to demonstrate:

Screenshot 2019-04-01 16 27 57

Screenshot 2019-04-01 16 28 14

Pressing <tab> again does not delete additional characters.

So far, this only seems to happen when the package section is present.

Expected Behavior
The character under the cursor should not be deleted.

Relevant Fish Configuration

# I am using the default Spacefish fish_prompt.fish

# config.fish
set -g SPACEFISH_CHAR_SYMBOL "❯"
set -g SPACEFISH_PROMPT_DEFAULT_SUFFIX " "
set -g SPACEFISH_PROMPT_SUFFIXES_SHOW true
set -g SPACEFISH_PROMPT_ORDER package

Environment

  • Spacefish version: 2.4.0
  • Fish version: 3.02
  • Fish plugin manager:
  • Terminal emulator: iTerm
  • Operating system: OSX 10.14.2
@matchai
Copy link
Owner

matchai commented Apr 1, 2019

Hey @pikeas!
Thank you for opening an issue. 😄

Unfortunately I'm having no luck reproducing the issue as described. Would you be able to provide a screen recording using asciicinema of the issue occurring so we can get a better idea of what is happening?

@matchai matchai added the Type: Bug Fix an existing bug label Apr 1, 2019
@pikeas
Copy link
Author

pikeas commented Apr 2, 2019

@matchai Thanks for the quick reply! Here's a recording: https://asciinema.org/a/PGuwaFqRyQ2OzmuIQCDZtn99B

Please let me know if you'd like any additional information about my environment. After the above video, I removed package from my prompt, sourced my config file, and the bug was gone.

@matchai
Copy link
Owner

matchai commented Apr 2, 2019

@pikeas does the issue occur when using a multi-line prompt? (e.g. having line-sep in SPACEFISH_PROMPT_ORDER)
I'm thinking it may be an issue with the character width of the emoji on the same line as the prompt which may be causing the issue.

If the issue doesn't occur when the prompt is on the next line, make sure you're using iTerm2 v3 and in Preferences > Profiles > Text, use the following settings:

image

Then, add the following to your fish config:

# Set the emoji character width
set -g fish_emoji_width 2

@pikeas
Copy link
Author

pikeas commented Apr 2, 2019

That did the trick! I already had Use Unicode version 9 widths enabled, but did not have fish_emoji_width set. Thanks!

@matchai
Copy link
Owner

matchai commented Apr 2, 2019

No problem. Glad that solved it! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Fix an existing bug
Projects
None yet
Development

No branches or pull requests

2 participants