matchai / spacefish

🚀🐟 The fish shell prompt for astronauts
https://spacefish.matchai.dev
MIT License
963 stars 79 forks source link

It doesn't wrap if the number of characters exceeds columns of terminal #123

Closed smorimoto closed 5 years ago

smorimoto commented 5 years ago

Bug Report

Current Behavior

It doesn't wrap if the number of characters exceeds columns of terminal.

Expected Behavior

It should wrap like pure theme.

Environment

Additional context/Screenshots

Spacefish Pure
Snuggle commented 5 years ago

Interesting, two quick-questions to start:

Where does the Pure prompt implement this text wrapping? How many other terminal prompts wrap in a similar fashion?

smorimoto commented 5 years ago

Hi! Hmm... I really don't familiar with fish shell, so I couldn't find. and I've not checked other themes except Pure, but I can check the other ones when I have much time.

Snuggle commented 5 years ago

image

Is this what you're referring to?

Snuggle commented 5 years ago

Hm, I can reproduce & this causes some incredibly weird behaviour. Typing exit exits the terminal emulator. I've seen this a couple of times before, but didn't know what caused it.

This completely breaks the prompt and I can't find a way to resolve it without reopening a new terminal instance.

image image

matchai commented 5 years ago

This is actually deliberate behavior in fish: https://github.com/fish-shell/fish-shell/issues/904#issuecomment-21162556 There has been a proposal in a past issue to identify when text wraps and to dynamically shorten or split the prompt based on the width of the terminal. I'd consider it if that's what zsh does natively.

Snuggle commented 5 years ago

It completely breaks the fish instance though? Commands like ls stop working entirely afterwards?

matchai commented 5 years ago

Oof. Yeah, didn't expect that to happen. 😰 Unfortunately, this still appears to be an upstream issue, being able to reproduce it without spacefish installed: image

Snuggle commented 5 years ago

Is there a workaround we could make to get around this issue? I've had it myself a few times and just ended up opening a new terminal instance instead.

matchai commented 5 years ago

I think anything we end up doing here would be hacky and this would best be addressed by the fish team, unless we decide to make the theme dynamically resizing based on $COLUMNS.

Closing this as it's not an issue in spacefish, but feel free to keep the conversation going. 😄