warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.11k stars 361 forks source link

fish not loading properly when Warp starts #1869

Open Bolognafingers opened 2 years ago

Bolognafingers commented 2 years ago

Discord username (optional)

No response

Describe the bug

I have a file that I expect to be loaded by fish every time fish starts, namely: ~/.config/fish/conf.d/abbr.fish which loads my abbreviations. It isn't loaded.

When I use Warp this file isn't loaded initially, but if I start a Warp-session and invoke fish the file is indeed loaded. The easiest way to test this is to create that file and add a line, echo "Setting abbreviations" at the top and re-start Warp. The line will not be echoed. Invoking fish will however result in the line being echoed.

Consequently, opening a new ITerm2 window fill echo the line initially which is what is expected.

To Reproduce

  1. Create debugging echo,
echo "echo \"Setting abbreviations\"" >> ~/.config/fish/conf.d/abbr.fish
  1. Re-start Warp, observe that nothing is printed
  2. Invoke Fish inside Warp, observe that the line is printed
  3. Start another Terminal such as ITerm2, observe that the line is printed

Expected behaviour

On Step 2 in Reproduce see that the echo line is executed

Screenshots

Screenshot 2022-09-23 at 07 28 01

Operating System

MacOS

OS Version

12.5.1

Shell Version

fish, version 3.5.1

Warp Version

v0.2022.09.20.08.08.stable_01

Additional context

No response

Does this block you from using Warp daily?

Yes

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

No response

dannyneira commented 1 year ago

Hi @Bolognafingers, Sorry to hear about this inconvenience. Thanks for letting us know. We will post updates on the thread here when this is being worked on.

rafaelfl commented 1 year ago

In my environment, when opening a new session, warp shows the message "Starting fish", but it doesn't load any of the fish configs, such as my prompt (I can only see the ~, instead of package version and git branch). When I manually run the shell, it works properly - the issue only happens during the startup. Using version v0.2022.12.13.08.04.stable_01.

Btw, great tool guys!

zoomido commented 1 year ago

I have the same issue. When I start warp it says Starting fish... (and then it gives me two prompts in a row, but seems to be an issue with the pure prompt plugin somehow). But I don't get any fish abbreviations (they do seem to load on pressing enter similar to https://github.com/warpdotdev/Warp/issues/1895 & https://github.com/warpdotdev/Warp/issues/852) or any configs loaded until I invoke another fish shell. I've included a screenshot that seems to show that fish is run with different starting parameters if started by warp or manually, don't know if this helps debugging. image

randianb commented 1 year ago

I have the same issue. "config.fish" is not loaded here

image
jausmann-wc commented 1 year ago

I have the same issue: v0.2023.04.25.08.05.stable_00 fish, version 3.3.1 MacOS Ventura 13.1

image
dannyneira commented 1 year ago

Hi @jausmann-wc Please try upgrading fish to a version above 3.4.0 and let us know if that helps with the issue. https://docs.warp.dev/help/known-issues#fish-shell-read-command

jausmann-wc commented 1 year ago

@dannyneira The issue somehow resolved itself after upgrading fish to 3.5.1 but not immediately after the upgrade.

dannyneira commented 1 year ago

@Bolognafingers Are you still seeing this issue with the most recent version of fish 3.6.1 and since the launch of Fish abbreviations in Warp version v0.2023.04.25.08.05.stable_00?

danielpavone commented 1 year ago

Hi @dannyneira ! I'm getting the same error. Using latest version v0.2023.05.09.08.03.stable_01 and fish 3.6.1.

vorporeal commented 1 year ago

@danielpavone Would you be willing to provide your fish config files so that we can attempt to reproduce the error?

danielpavone commented 1 year ago

@vorporeal I've got just it on my config


if status is-interactive
end

alias pn=pnpm
set JAVA_HOME /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
set PATH $ANDROID_HOME/emulator $PATH
set PATH $ANDROID_HOME/tools $PATH
set PATH $ANDROID_HOME/tools/bin $PATH
set PATH $ANDROID_HOME/plataform-tools $PATH
set PATH $HOME/.local/bin $PATH

starship init fish | source

# pnpm
set -gx PNPM_HOME "/Users/daniel.pavone/Library/pnpm"
if not string match -q -- $PNPM_HOME $PATH
  set -gx PATH "$PNPM_HOME" $PATH
end
# pnpm end
tlaak commented 1 year ago

My fish config was working just fine until I got tired of the slow start warnings and decided to optimise it a little bit. Now I'm facing exactly the same problem as the others in this thread. It works fine on Terminal and iTerm, and also if I open a fish subshell. It just doesn't seem to load the config on the default shell at all when opening Warp. Echoing a single line at the beginning of the config will output nothing.

macOS Ventura 13.4 fish 3.61 (via homebrew) Warp v0.2023.06.06.08.02.stable_00

zachbai commented 1 year ago

Hey @tlaak -- would you mind sharing your config.fish? Feel free to redact any personal/sensitive info.

I'm also curious about the change you made to optimize it -- sounds like that might be able to give us a good idea of whats going on here.

tlaak commented 1 year ago

@zachbai Apologies for not responding but I've been way too busy recently. My problem disappeared after a Warp update so hopefully that was it.

zachbai commented 1 year ago

@tlaak no worries, thanks for following up.

To other following this thread- please ping if the issue's persisting for you, otherwise we'll close it out shortly

wim-web commented 1 year ago

I'm encountering a similar problem. I've created ~/.config/fish/completions/ave.fish for completion, but it's not being loaded. No problem with iterm2.

nickolasclarke commented 9 months ago

@zachbai still encountering this on v0.2024.01.02.08.02.stable_02

nickolasclarke commented 8 months ago

@zachbai any updates on this?

zachbai commented 8 months ago

@nickolasclarke which config files (at which paths?) aren't being loaded for you?

@wim-web Unfortunately native fish completion definitions won't work with Warp -- Warp has a custom completions engine that's decoupled from the shell.

nickolasclarke commented 8 months ago

@zachbai I actually believe that this is due to warp using its own prompt instead of PS1. I had not noticed this change in the settings and was confused why my prompt from fish_config was not being used unless I invoked a subshell with fish. The slow load time was finally resolved in a recent update.

sperez-tef commented 7 months ago

Hi, in case it helps, I'm having the same issue. Let me paste some of my config files:

~/.config/fish/config.fish

source /home/username/.config/fish/conf.d/*.fish

~/.config/fish/conf.d/ctrlz.fish

bind \cz 'fg 2&>/dev/null'

Those files are loaded from other terminals, and in a fish subshell, but they are not on the default one

OS: Manjaro Warp version: v0.2024.02.20.08.01.stable_02-1 fish version: 3.7.0-1

sangm commented 6 months ago

Facing the same issue, specifically for me, I depend on the config.fish to execute

eval "$(/opt/homebrew/bin/brew shellenv)"

I went into a rabbit hole of why my brew installations were for x86 and not arm.

is anyone taking a look?

anothermh commented 3 months ago

Warp just does not read config.fish on startup. ~/.config/fish/ has been erased and recreated, and ~/.config/fish/config.fish has been recreated with only:

if status is-interactive
    # Commands to run in interactive sessions can go here
end

echo "Hello World"

Starting Warp does not render the output. Running fish as a subshell does read config.fish properly. But then the "Warpify subshell" returns an error:

command: -p: unknown option

This all surfaced because $PATH in Warp + fish was completely wrong and caused all sorts of unexpected behavior. And subshells are not a usable solution because they inherit $PATH from the parent process, which is already incorrect, and running config.fish at that point does not put it back in the right order.

Warp + fish is unusable.

fish, version 3.7.1 Warp, v0.2024.06.25.08.02.stable_01