matchai / spacefish

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

exec_time not work #65

Closed nasyxx closed 5 years ago

nasyxx commented 5 years ago

Bug Report

Current Behavior exec_time not work

Expected Behavior it will have a section with "took 3s" when sleep 3

Relevant Fish Configuration

# Your configuration here
  # Prompt
  set SPACEFISH_PROMPT_DEFAULT_PREFIX "with "
  set SPACEFISH_CHAR_SYMBOL "λ"
  # Time
  set SPACEFISH_TIME_SHOW true
  set SPACEFISH_TIME_FORMAT (date '+%b %d, %y %T')
  set SPACEFISH_TIME_COLOR yellow
  set SPACEFISH_EXEC_TIME_ELAPSED 1
  # user
  set SPACEFISH_USER_SHOW always
  set SPACEFISH_USER_COLOR cyan
  # git
  set SPACEFISH_GIT_STATUS_SHOW true
  # dir
  set SPACEFISH_DIR_TRUNC 0
  set SPACEFISH_DIR_TRUNC_REPO false
  set SPACEFISH_DIR_COLOR blue
  # battery
  set SPACEFISH_BATTERY_SHOW always
  # exit code
  set SPACEFISH_EXIT_CODE_SHOW true

  # order
  set SPACEFISH_PROMPT_ORDER user battery time host package node ruby golang haskell pyenv exec_time exit_code line_sep jobs dir git line_sep char
  set SPACEFISH_RPROMPT_ORDER exec_time git battery

Environment

Possible Solution

Seems in my fish shell, there is no var named CMD_DURATION but cmd_duration, thus, when I changed $CMD_DURATION to $cmd_duration in __sf_section_exec_time.fish, it works well.

matchai commented 5 years ago

Hey, nasyxx!

Thanks for opening this issue. 😄

It looks like this was caused by the following fish commit: https://github.com/fish-shell/fish-shell/commit/18b06f3768d6f964dd2c679aee2e80a21c820fe4.

Strangely, I am also running 2.7.1 but haven't encountered these changes. In any case, it looks like $cmd_duration will be the standard starting fish 3.0.