Git Product home page Git Product logo

Comments (9)

jorgebucaran avatar jorgebucaran commented on August 26, 2024 1

@brandonpittman Yup. That's the pipestatus. See https://fishshell.com/docs/current/language.html#variables-status.

from hydro.

brandonpittman avatar brandonpittman commented on August 26, 2024 1

@jorgebucaran Never knew about that. Thanks for the link.

from hydro.

jorgebucaran avatar jorgebucaran commented on August 26, 2024

Hydro only shows the exit status AFAIC. Can you share a screenshot?

~/C/hydro main ❱ foo
fish: Unknown command: foo
~/C/hydro main [127] 

from hydro.

bwolf avatar bwolf commented on August 26, 2024

Example with fish shell 3.2.2 and Hydro a5877e9ef76b3e915c06143630bffc5ddeaba2a1 which is the commit from 2021-05-15:

~/s/p/p/project master ❱ mvn clean test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.892 s
[INFO] Finished at: 2021-11-01T19:08:03+01:00
[INFO] ------------------------------------------------------------------------
~/s/p/p/project master /nix/store/dj7xwrgp4kjl36f09yyqsl1ay8glxk5b-lorri-keep-env-hack-nix-shell 1.8s [1]

Note: this only happens when running a command in a directory which is baked by direnv and a shell.nix Nix environment. Running it outside, say in ~, only the exit code is printed.

~ ❱ zsh -c 'sleep 2; exit 0'
~ 2s ❱ zsh -c 'sleep 2; exit 1'
~ 2s [1]

from hydro.

jorgebucaran avatar jorgebucaran commented on August 26, 2024

Hydro only prints the error code when exit code != 0. This must be the git prompt behaving erratically.

hydro/conf.d/hydro.fish

Lines 52 to 85 in cf7b198

fish --private --command "
! command git --no-optional-locks rev-parse 2>/dev/null && set $_hydro_git && exit
set branch (
command git symbolic-ref --short HEAD 2>/dev/null ||
command git describe --tags --exact-match HEAD 2>/dev/null ||
command git rev-parse --short HEAD 2>/dev/null |
string replace --regex -- '(.+)' '@\$1'
)
test -z \"\$$_hydro_git\" && set --universal $_hydro_git \"\$branch \"
! command git diff-index --quiet HEAD 2>/dev/null ||
count (command git ls-files --others --exclude-standard) >/dev/null &&
set info \"$hydro_symbol_git_dirty\"
for fetch in $hydro_fetch false
command git rev-list --count --left-right @{upstream}...@ 2>/dev/null |
read behind ahead
switch \"\$behind \$ahead\"
case \" \" \"0 0\"
case \"0 *\"
set upstream \" $hydro_symbol_git_ahead\$ahead\"
case \"* 0\"
set upstream \" $hydro_symbol_git_behind\$behind\"
case \*
set upstream \" $hydro_symbol_git_ahead\$ahead $hydro_symbol_git_behind\$behind\"
end
set --universal $_hydro_git \"\$branch\$info\$upstream \"
test \$fetch = true && command git fetch --no-tags 2>/dev/null
end

from hydro.

brandonpittman avatar brandonpittman commented on August 26, 2024

I often see error codes like [0|1]. Can’t remember if there’s a type of command that consistently causes that though.

from hydro.

bwolf avatar bwolf commented on August 26, 2024

Ok thanks, I assume this has nothing to do with Hydro.

from hydro.

okkdev avatar okkdev commented on August 26, 2024

Sorry for commenting on a closed issue, but did you find a solution for this issue? @bwolf

from hydro.

bwolf avatar bwolf commented on August 26, 2024

@okkdev unfortunately not.

from hydro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.