Closed Rodrirokr closed 4 years ago
What is the output of the following command?
() {
emulate -L zsh -o xtrace
local todo=$commands[todo.sh]
typeset -pm 'POWERLEVEL9K_*|ZSH_VERSION|_p9k_todo_file|todo'
[[ -n $todo ]] || return
todo -p ls | tail -1
bash -c "
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo/config
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/todo.cfg
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo.cfg
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${XDG_CONFIG_HOME:-\$HOME/.config}/todo/config
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=${(qqq)todo:h}/todo.cfg
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config}
[ -r \"\$TODOTXT_CFG_FILE\" ] || exit
source \"\$TODOTXT_CFG_FILE\"
echo \"\$TODO_FILE\""
}
At first the output had this line almost at the end.
+(anon):5> todo -p ls
(anon):5: command not found: todo
But after aliasing todo to todo.sh in my .zshrc the output was the following:
typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VIVIS_FOREGROUND=76
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VIVIS_CONTENT_EXPANSION=Ⅴ
typeset -g POWERLEVEL9K_SHORTEN_DELIMITER=''
typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n at %m'
typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232
typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
typeset -g POWERLEVEL9K_BATTERY_CHARGED_FOREGROUND=2
typeset -g -a POWERLEVEL9K_PYENV_SOURCES=( shell local global )
typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false
typeset -g -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( todo os_icon user dir vcs newline prompt_char )
typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VIINS_CONTENT_EXPANSION=❯
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B6'
typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER// }'
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER// }'
typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VIINS_FOREGROUND=196
typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0
typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false
typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'
typeset -g -a POWERLEVEL9K_KUBECONTEXT_CLASSES=( '*' DEFAULT )
typeset -g ZSH_VERSION=5.7.1
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=''
typeset -g POWERLEVEL9K_CONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}'
typeset -g POWERLEVEL9K_NODEENV_LEFT_DELIMITER=''
typeset -g POWERLEVEL9K_NORDVPN_CONNECTING_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VIOWR_FOREGROUND=76
typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0
typeset -g POWERLEVEL9K_CUSTOM_WIFI_SIGNAL=zsh_wifi_signal
typeset -g POWERLEVEL9K_BATTERY_CHARGING_FOREGROUND=2
typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=''
typeset -g POWERLEVEL9K_VCS_PREFIX='on '
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=' '
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B5'
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_LEFT_WHITESPACE=''
typeset -g POWERLEVEL9K_STATUS_OK=false
typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION=✘
typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3
typeset -g POWERLEVEL9K_NORDVPN_DISCONNECTING_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true
typeset -g POWERLEVEL9K_CONTEXT_SUDO_CONTENT_EXPANSION=''
typeset -g _p9k_todo_file=/bin/todo.txt
typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80
typeset -g -a POWERLEVEL9K_VCS_BACKENDS=( git )
typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VICMD_FOREGROUND=76
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
typeset -g POWERLEVEL9K_NORDVPN_DISCONNECTED_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=true
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_SUDO_BACKGROUND=0
typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=''
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_TEMPLATE=%n@%m
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VIVIS_CONTENT_EXPANSION=Ⅴ
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER// }'
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
typeset -g POWERLEVEL9K_STATUS_ERROR=false
typeset -g POWERLEVEL9K_DIR_FOREGROUND=254
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=''
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=%238F─╮
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=%238F─┤
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
typeset -g POWERLEVEL9K_NORDVPN_DISCONNECTED_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION=✔
typeset -g POWERLEVEL9K_CONTEXT_SUDO_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_CONTEXT_DEFAULT_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VICMD_CONTENT_EXPANSION=❮
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B7'
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER='(.bzr|.citc|.git|.hg|.node-version|.python-version|.ruby-version|.shorten_folder_marker|.svn|.terraform|CVS|Cargo.toml|composer.json|go.mod|package.json)'
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_SUDO_TEMPLATE=%n@%m
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_BACKGROUND=0
typeset -g POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER=''
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=''
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B4'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VIOWR_CONTENT_EXPANSION=▶
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VIVIS_FOREGROUND=196
typeset -g POWERLEVEL9K_NORDVPN_CONNECTING_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with '
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
typeset -g -a POWERLEVEL9K_RBENV_SOURCES=( shell local global )
typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7
typeset todo=/usr/local/bin/todo.sh
typeset -g POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER=''
typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER// }'
typeset -g POWERLEVEL9K_VCS_UNSTAGED_MAX_NUM=-1
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VIINS_FOREGROUND=76
typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE
typeset -g POWERLEVEL9K_VCS_STAGED_MAX_NUM=-1
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=%238F─╯
typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1
typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*'
typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1
typeset -g -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( status command_execution_time background_jobs direnv virtualenv anaconda pyenv goenv nodenv nvm nodeenv rbenv rvm fvm kubecontext terraform aws context nordvpn ranger vim_shell vi_mode time newline battery custom_wifi_signal )
typeset -g POWERLEVEL9K_NODEENV_RIGHT_DELIMITER=''
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
typeset -g POWERLEVEL9K_VCS_CONFLICTED_MAX_NUM=-1
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_RIGHT_WHITESPACE=''
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION=✘
typeset -g POWERLEVEL9K_ANACONDA_LEFT_DELIMITER=''
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n at %m'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_VIINS_CONTENT_EXPANSION=❯
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=''
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
typeset -g POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM=-1
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION=✔
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6'
typeset -g POWERLEVEL9K_BATTERY_STAGES=
typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3
typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
typeset -g POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER=''
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VIOWR_FOREGROUND=196
typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2
typeset -g POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM=-1
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took '
typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0
typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
typeset -g POWERLEVEL9K_MODE=nerdfont-complete
typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at '
typeset -g POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM=-1
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=''
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_SUDO_FOREGROUND=3
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION=✘
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4'
typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER// }'
typeset -g POWERLEVEL9K_LOAD_WHICH=5
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VICMD_CONTENT_EXPANSION=❮
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VICMD_FOREGROUND=196
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
typeset -g POWERLEVEL9K_TIME_PREFIX='at '
typeset -g -a POWERLEVEL9K_AWS_CLASSES=( '*' DEFAULT )
typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false
typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL
typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_VIOWR_CONTENT_EXPANSION=▶
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_FOREGROUND=3
typeset -g POWERLEVEL9K_NORDVPN_DISCONNECTING_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=''
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250
typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='%B${P9K_CONTENT// }'
TODO: 4 of 4 tasks shown
./todo.txt
+(anon):2> local todo=/usr/local/bin/todo.sh
+(anon):3> typeset -pm 'POWERLEVEL9K_*|ZSH_VERSION|_p9k_todo_file|todo'
+(anon):4> [[ -n /usr/local/bin/todo.sh ]]
+(anon):5> todo.sh -p ls
+(anon):5> tail -1
+(anon):6> bash -c $'\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=$HOME/.todo/config\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=$HOME/todo.cfg\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=$HOME/.todo.cfg\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=${XDG_CONFIG_HOME:-$HOME/.config}/todo/config\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE="/usr/local/bin"/todo.cfg\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config}\n [ -r "$TODOTXT_CFG_FILE" ] || exit\n source "$TODOTXT_CFG_FILE"\n echo "$TODO_FILE"'
The output looks unexpected. I don't yet understand what's going on. Let's try this:
() {
emulate -L zsh -o xtrace
local todo=$commands[todo.sh]
typeset -pm '_p9k_todo_file|todo'
[[ -n $todo ]] || return
$todo -p ls | tail -1
bash -xc "
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo/config
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/todo.cfg
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo.cfg
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${XDG_CONFIG_HOME:-\$HOME/.config}/todo/config
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=${(qqq)todo:h}/todo.cfg
[ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config}
[ -r \"\$TODOTXT_CFG_FILE\" ] || exit
echo \"\$TODOTXT_CFG_FILE\"
cat \"\$TODOTXT_CFG_FILE\"
source \"\$TODOTXT_CFG_FILE\"
echo \"\$TODO_FILE\"
echo \"\$TODO_DIR\""
} 1>&2
What is the output?
Sorry for answering too late, I wasn't available. Here is the output of the command.
+(anon):2> local todo=/usr/local/bin/todo.sh
+(anon):3> typeset -pm '_p9k_todo_file|todo'
typeset -g _p9k_todo_file=/bin/todo.txt
typeset todo=/usr/local/bin/todo.sh
+(anon):4> [[ -n /usr/local/bin/todo.sh ]]
+(anon):5> /usr/local/bin/todo.sh -p ls
+(anon):5> tail -1
TODO: 4 of 4 tasks shown
+(anon):6> bash -xc $'\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=$HOME/.todo/config\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=$HOME/todo.cfg\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=$HOME/.todo.cfg\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=${XDG_CONFIG_HOME:-$HOME/.config}/todo/config\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE="/usr/local/bin"/todo.cfg\n [ -e "$TODOTXT_CFG_FILE" ] || TODOTXT_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config}\n [ -r "$TODOTXT_CFG_FILE" ] || exit\n echo "$TODOTXT_CFG_FILE"\n cat "$TODOTXT_CFG_FILE"\n source "$TODOTXT_CFG_FILE"\n echo "$TODO_FILE"\n echo "$TODO_DIR"'
+ '[' -e '' ']'
+ TODOTXT_CFG_FILE=/Users/Rodrigo/.todo/config
+ '[' -e /Users/Rodrigo/.todo/config ']'
+ TODOTXT_CFG_FILE=/Users/Rodrigo/todo.cfg
+ '[' -e /Users/Rodrigo/todo.cfg ']'
+ TODOTXT_CFG_FILE=/Users/Rodrigo/.todo.cfg
+ '[' -e /Users/Rodrigo/.todo.cfg ']'
+ '[' -e /Users/Rodrigo/.todo.cfg ']'
+ '[' -e /Users/Rodrigo/.todo.cfg ']'
+ '[' -r /Users/Rodrigo/.todo.cfg ']'
+ echo /Users/Rodrigo/.todo.cfg
/Users/Rodrigo/.todo.cfg
+ cat /Users/Rodrigo/.todo.cfg
# === EDIT FILE LOCATIONS BELOW ===
# Your todo.txt directory (this should be an absolute path)
export TODO_DIR="/Users/Rodrigo/Documents/todo"
export TODO_DIR=$(dirname "$0")
# Your todo/done/report.txt locations
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt"
# You can customize your actions directory location
#export TODO_ACTIONS_DIR="$HOME/.todo.actions.d"
# == EDIT FILE LOCATIONS ABOVE ===
# === COLOR MAP ===
## Text coloring and formatting is done by inserting ANSI escape codes.
## If you have re-mapped your color codes, or use the todo.txt
## output in another output system (like Conky), you may need to
## over-ride by uncommenting and editing these defaults.
## If you change any of these here, you also need to uncomment
## the defaults in the COLORS section below. Otherwise, todo.txt
## will still use the defaults!
# export BLACK='\\033[0;30m'
# export RED='\\033[0;31m'
# export GREEN='\\033[0;32m'
# export BROWN='\\033[0;33m'
# export BLUE='\\033[0;34m'
# export PURPLE='\\033[0;35m'
# export CYAN='\\033[0;36m'
# export LIGHT_GREY='\\033[0;37m'
# export DARK_GREY='\\033[1;30m'
# export LIGHT_RED='\\033[1;31m'
# export LIGHT_GREEN='\\033[1;32m'
# export YELLOW='\\033[1;33m'
# export LIGHT_BLUE='\\033[1;34m'
# export LIGHT_PURPLE='\\033[1;35m'
# export LIGHT_CYAN='\\033[1;36m'
# export WHITE='\\033[1;37m'
# export DEFAULT='\\033[0m'
# === COLORS ===
## Uncomment and edit to override these defaults.
## Reference the constants from the color map above,
## or use $NONE to disable highlighting.
#
# Priorities can be any upper-case letter.
# A,B,C are highlighted; you can add coloring for more.
#
# export PRI_A=$YELLOW # color for A priority
# export PRI_B=$GREEN # color for B priority
# export PRI_C=$LIGHT_BLUE # color for C priority
# export PRI_D=... # define your own
# export PRI_X=$WHITE # color unless explicitly defined
# There is highlighting for tasks that have been done,
# but haven't been archived yet.
#
# export COLOR_DONE=$LIGHT_GREY
# There is highlighting for projects and contexts.
#
# export COLOR_PROJECT=$RED
# export COLOR_CONTEXT=$RED
# === BEHAVIOR ===
## customize list output
#
# TODOTXT_SORT_COMMAND will filter after line numbers are
# inserted, but before colorization, and before hiding of
# priority, context, and project.
#
# export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -f -k2'
# TODOTXT_FINAL_FILTER will filter list output after colorization,
# priority hiding, context hiding, and project hiding. That is,
# just before the list output is displayed.
#
# export TODOTXT_FINAL_FILTER='cat'
+ source /Users/Rodrigo/.todo.cfg
++ export TODO_DIR=/Users/Rodrigo/Documents/todo
++ TODO_DIR=/Users/Rodrigo/Documents/todo
+++ dirname bash
++ export TODO_DIR=.
++ TODO_DIR=.
++ export TODO_FILE=./todo.txt
++ TODO_FILE=./todo.txt
++ export DONE_FILE=./done.txt
++ DONE_FILE=./done.txt
++ export REPORT_FILE=./report.txt
++ REPORT_FILE=./report.txt
+ echo ./todo.txt
./todo.txt
+ echo .
.
Thanks. The logs are very helpful. The bug should be fixed now. Please update and let me know if todo
prompt segment works for you now.
There is an unusual bit in your config (/Users/Rodrigo/.todo.cfg
). I'm wondering if it's intentional.
export TODO_DIR=$(dirname "$0")
Here $0
is /usr/local/bin/todo.sh
, which implies TODO_DIR=/usr/local/bin
. Apparently you are storing your TODOs in /usr/local/bin
.
Omg! mine was a case of RTFM, sorry for using your time as support, also this answer helped me with the TODO_DIR=/usr/local/bin
issue.
I've updated the project and successfully now display the segment in the default dir (/usr/local/bin
), thank you so much.
Thanks for the confirmation that it works now.
Hi
I'm having an issue regarding the todo.txt segment using the powerlevel10k theme, at first I thought that it was something related to the issue #83 so I ran the same tests without luck. Here is my
.p10.zsh
with the todo segment:Then, I changed the theme to
ZSH_THEME="powerlevel9k/powerlevel9k"
, that theme succesfully displays the todo segment, here are some screenshots before and after:The second screenshot have some command not found warnings, I think that's why its wrongly displayed.
Thank you in advance.