Erlang shell - 没有命令输入

时间:2017-09-03 20:07:54

标签: erlang archlinux erlang-shell

我的操作系统:arch linux。我最近安装了erlang(Erlang(BEAM)模拟器版本9.0.1)。

当我输入“erl”命令时,我希望erlang shell开始调用我输入的命令(对于最简单的例子:2 + 3。应该返回5)

然而,在我运行“erl”后,屏幕上没有显示任何内容。我可以输入任何我想要的东西,什么都不执行附有带有示例的图像。

What I expect.jpg

What I got.jpg

现在我才开始学习erlang,这很令人困惑。不知道是否存在某些存储库错误或erlang正常行为?

UPD:我在.bashrc文件中有一些自定义配置:

# setup color variables
color_is_on=
color_red=
color_green=
color_yellow=
color_blue=
color_white=
color_gray=
color_bg_red=
color_off=
color_user=
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    color_is_on=true
    color_black="\[$(/usr/bin/tput setaf 0)\]"
    color_red="\[$(/usr/bin/tput setaf 1)\]"
    color_green="\[$(/usr/bin/tput setaf 2)\]"
    color_yellow="\[$(/usr/bin/tput setaf 3)\]"
    color_blue="\[$(/usr/bin/tput setaf 6)\]"
    color_white="\[$(/usr/bin/tput setaf 7)\]"
    color_gray="\[$(/usr/bin/tput setaf 8)\]"
    color_off="\[$(/usr/bin/tput sgr0)\]"

    color_error="$(/usr/bin/tput setab 1)$(/usr/bin/tput setaf 7)"
    color_error_off="$(/usr/bin/tput sgr0)"

    # set user color
    case `id -u` in
        0) color_user=$color_red ;;
        *) color_user=$color_green ;;
    esac
fi



function prompt_command {
    # get cursor position and add new line if we're not in first column
    exec < /dev/tty
    local OLDSTTY=$(stty -g)
    stty raw -echo min 0
    echo -en "\033[6n" > /dev/tty && read -sdR CURPOS
    stty $OLDSTTY
    [[ ${CURPOS##*;} -gt 1 ]] && echo "${color_error}↵${color_error_off}"


    # build b/w prompt for git and vertial env
    [[ ! -z $GIT_BRANCH ]] && PS1_GIT=" (git: ${GIT_BRANCH})"
    [[ ! -z $VIRTUAL_ENV ]] && PS1_VENV=" (venv: ${VIRTUAL_ENV#$WORKON_HOME})"

    # calculate fillsize
    local fillsize=$(($COLUMNS-$(printf "${USER}@${HOSTNAME}:${PWD}:${PWDNAME}${PS1_GIT}${PS1_VENV} " | wc -c | tr -d " ")))

    local FILL=$color_white
    while [ $fillsize -gt 0 ]; do FILL="${FILL}─"; fillsize=$(($fillsize-1)); done
    FILL="${FILL}${color_off}"



    # set new color prompt
    PS1="${color_user}${USER}${color_off}@${color_yellow}${HOSTNAME}${color_off}:${color_white}${PWD}:${PWDNAME}${color_off}${PS1_GIT}${PS1_VENV} ${FILL}\n➜ "
}


PROMPT_COMMAND=prompt_command

删除此配置后,erl开始正常工作。

0 个答案:

没有答案