jorgebucaran / hydro

Ultra-pure, lag-free prompt with async Git status—just for Fish
MIT License
598 stars 52 forks source link

Elapsed time includes absolute path to `$pwd` #55

Open ecarlson94 opened 2 weeks ago

ecarlson94 commented 2 weeks ago

The elapsed time portion if my prompt includes the entire path to pwd plus a couple of directories: image

Here is my config.fish ```bash # ~/.config/fish/config.fish: DO NOT EDIT -- this file has been generated # automatically by home-manager. # Only execute this file once per shell. set -q __fish_home_manager_config_sourced; and exit set -g __fish_home_manager_config_sourced 1 source /nix/store/jvdphk4ax16yxzj2b8hcpm2j8k1waf7l-hm-session-vars.fish fish_config theme choose "Catppuccin Mocha" eval (/nix/store/php4qidg2bxzmm79vpri025bqi0fa889-coreutils-9.5/bin/dircolors -c ~/.dir_colors) status is-login; and begin # Login shell initialisation end status is-interactive; and begin # Interactive shell initialisation /nix/store/0qygwgixvg42d5lhfkj18b1zvclmcvc4-fzf-0.52.1/bin/fzf --fish | source set fish_greeting # Disable greeting set hydro_color_pwd $fish_color_cwd set hydro_color_git $fish_color_host set hydro_color_prompt $fish_color_host_remote if set -q KITTY_INSTALLATION_DIR set --global KITTY_SHELL_INTEGRATION no-rc source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish" set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d" end # add completions generated by Home Manager to $fish_complete_path begin set -l joined (string join " " $fish_complete_path) set -l prev_joined (string replace --regex "[^\s]*generated_completions.*" "" $joined) set -l post_joined (string replace $prev_joined "" $joined) set -l prev (string split " " (string trim $prev_joined)) set -l post (string split " " (string trim $post_joined)) set fish_complete_path $prev "/home/walawren/.local/share/fish/home-manager_generated_completions" $post end /nix/store/35klgzald67mkslqb9kkv01gn98zfbza-direnv-2.34.0/bin/direnv hook fish | source end ```
Here is my plugin-hydro.fish ```fish # Plugin hydro set -l plugin_dir /nix/store/h44v3fqpf2pcrqjqmrr8y3dj6xqd699f-source # Set paths to import plugin components if test -d $plugin_dir/functions set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1] end if test -d $plugin_dir/completions set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1] end # Source initialization code if it exists. if test -d $plugin_dir/conf.d for f in $plugin_dir/conf.d/*.fish source $f end end if test -f $plugin_dir/key_bindings.fish source $plugin_dir/key_bindings.fish end if test -f $plugin_dir/init.fish source $plugin_dir/init.fish end ```
ecarlson94 commented 2 weeks ago

I'm not sure if this is intentional, but I have discovered that this only happens when I am in a devshell using direnv. Maybe because of one of these variables that gets exported?

+AR +AS +CC +CLASSPATH +CONFIG_SHELL +CXX +DETERMINISTIC_BUILD +HOST_PATH +IN_NIX_SHELL +JAVA_HOME +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS +NIX_STORE +NM +NODE_PATH +OBJCOPY +OBJDUMP +PYTHONHASHSEED +PYTHONNOUSERSITE +PYTHONPATH +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +_PYTHON_HOST_PLATFORM +_PYTHON_SYSCONFIGDATA_NAME +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

If this isn't worth your time, I get it. I'm just hoping the fix might be something simple.

jorgebucaran commented 1 week ago

I also run Hydro in a system where we are supposed to use direnv and haven't had any problems yet. First, try commenting out your config.fish and Hydro plugins file to see if the problem persists. If I could get a repro of your system where the problem shows up, I would probably brute-force it by debugging this the old way, editing conf.d/hydro.fish directly.

ecarlson94 commented 1 week ago

I am new to both fish and hydro. My config.fish and hydro.fish are in the description as dropdowns. Is there something missing for reproducibility? Or are you asking me to slim them down?

I'll try slimming it down and updating the description this week.