# shellcheck shell=dash
___x_cmd_ted___cat_(){
    ___x_cmd_cmds_cat >/dev/tty <<A
Using Ctrl-D to finish input.
Using Ctrl-C to interrupt and then you can switch other editor like vim, gum, or other
A
    if [ "$#" -gt 0 ]; then
        ___x_cmd_cmds_cat >/dev/tty <<A
-- Initial value --
$*
A
    fi
    printf "%s\n" "------ BEGIN ------" >/dev/tty

    x_="$(___x_cmd_cmds_cat)" || {
        printf "\r%s\n" "------ INT ------" >/dev/tty
        printf "%s\n" "Received interrupt" >/dev/tty
        # TODO: you can choose to quit with 130 or switch editor here
        return 130
    }

    printf "\r\n%s\n\n" "------ END ------" >/dev/tty
}

___x_cmd_ted___cat(){
    local x_=""
    ___x_cmd_ted___cat_ "$@"|| return
    printf "%s\n" "$x_"
}
