我在Ubuntu 服务器gnome-terminal
上安装并发现了这个问题。
当我使用“ File
”->“ New Tab
”打开新选项卡时,gnome-terminal 将打开一个新选项卡,然后我尝试source
在“ ”后运行“ ”命令#
:
# source
sh: 1: source: not found
#
将会提示“ sh: 1: source: not found
”。
因此,Ubuntu 服务器中的 gnome-terminal 将sh
在新选项卡中运行。这将导致终端up
中的箭头键问题sh
:https://unix.stackexchange.com/questions/103608/is-there-any-reason-why-i-get-a-when-i-press-up-arrow-at-the-console-login-sc
我必须在“ bash
”之后运行“ #
”才能获得“ bash
”终端,以修复“ up
”箭头键问题:
# source
sh: 1: source: not found
# bash
root@test:~# source
bash: source: filename argument required
source: usage: source filename [arguments]
root@test:~#
Ubuntu 桌面上的 gnome-terminalbash
在新选项卡中总是使用“ ”。
如何设置 Ubuntu 服务器上的 gnome-terminal在点击“ ”->“ ”时使用“ bash
”而不是“ ”?sh
File
New Tab
您的用户已将其默认 shell 设置为 ,
/bin/sh
而不是/bin/bash
。您可以通过运行以下chsh
命令来修复此问题(使用您的用户名而不是terdon
):首先会提示您输入密码,然后输入您希望用户默认使用的 shell。对于您来说,您需要输入
/bin/bash
。您可以使用 查看所有可用的 shellchsh -l
。在我的(非 Ubuntu)系统上,我安装了一些额外的 shell,如下所示: