# We will override original pwd command
# User should use command pwd for original pwd
# User should just just use "$PWD" instead of using pwd command

___x_cmd_pwd___main(){
    { [ -t 1 ] && ___x_cmd_is_interactive; } || {
        printf "%s\n" "$PWD"
        return
    }

    local x_=""
    local p="$PWD"
    case "$p" in
        /*/*)
            local t=""
            local c033="$___X_CMD_UNSEENCHAR_033"

            t="${c033}[0;32m${p##*/}"
            x_="${c033}[0;34m${p%/*}/${t}${c033}[0m"
            printf "%s\n" "$x_"
            ;;
        *)
            printf "%s\n" "$p"
    esac

    # In the future, we could provide more options, but copy to pastebard always be the first option so user could using two enter to copy pwd.
    if ___x_cmd ui yesno "copy $PWD to pasteboard?"; then
        if ___x_cmd pb --cp "$PWD"; then
            x:info "copied to pasteboard ==> $PWD"
        else
            x:info "fail to copy to pasteboard ==> $PWD"
        fi
    fi

}
