纳米错误:打开终端时出错:xterm-256color
安装 OSX Lion 后,我尝试:
nano /etc/apt/sources.list
但出现此错误:
Error opening terminal: xterm-256color
如果我尝试切换terminal.app首选项以“xterm color”而不是xterm-256color
打开终端窗口,一切正常。
发生什么事了?
After the installation of OSX Lion, I tried to:
nano /etc/apt/sources.list
But I get this error:
Error opening terminal: xterm-256color
If I try to switch terminal.app preferences to open terminal windows in "xterm color" instead of xterm-256color
everything works fine.
What's happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
在红帽上,这对我有用:
这里有更多信息:https://web.archive.org/web/20220331072532/http://www.cloudfarm.it/fix-error-opening-terminal-xterm-256color-unknown-terminal-type/
On Red Hat this worked for me:
further info here: https://web.archive.org/web/20220331072532/http://www.cloudfarm.it/fix-error-opening-terminal-xterm-256color-unknown-terminal-type/
这在 Ubuntu 服务器上对我有用,通过 Erik Osterman< /a>.
This worked for me on a Ubuntu server, via Erik Osterman.
我可以确认这是一个 terminfo 问题。这对我有用。通过 SSH 连接到远程计算机并运行
Boom。问题解决了。
I can confirm this is a terminfo issue. This is what worked for me. SSH in to the remote machine and run
Boom. Problem solved.
编辑您的
.bash_profile
文件vim .bash_profile
commnet
#export TERM=xterm-256color
添加此
导出 TERMINFO=/usr/share/terminfo
导出 TERM=xterm-basic
在您的
.bash_profile
中
终于
运行:
source .bash_profile
edit your
.bash_profile
filevim .bash_profile
commnet
#export TERM=xterm-256color
add this
export TERMINFO=/usr/share/terminfo
export TERM=xterm-basic
to your
.bash_profile
finally
run:
source .bash_profile
我通过 Mac OS X Lion 连接到 http://sdf.org 时遇到问题。我在
Terminal Preferences
(⌘+,)> 下进行了更改高级
窗格中,将终端声明为
为VT-100
。我还标记了
Delete Sends Ctrl-H
,因为此 Mac 连接使zsh
令人困惑。它似乎适用于我的用例。
I had this problem connecting to http://sdf.org through Mac OS X Lion. I changed under
Terminal Preferences
(⌘+,)> Advanced
pane,Declare Terminal as
toVT-100
.I also marked
Delete Sends Ctrl-H
because this Mac connection was confusingzsh
.It appears to be working for my use case.
我在升级到 Lion 的旧 Mac 上也遇到了这个问题。
在阅读 terminfo 提示之前,我可以通过执行“export TERM=xterm”来获得 vi 并减少工作量。
阅读完该提示后,我从一台全新安装了 Lion 的较新 Mac 上获取了
/usr/share/terminfo
,并且没有出现此问题。现在,即使
echo $TERM
仍然产生xterm-256color
,vi 和 less 现在可以正常工作。I, too, have this problem on an older Mac that I upgraded to Lion.
Before reading the terminfo tip, I was able to get vi and less working by doing "export TERM=xterm".
After reading the tip, I grabbed
/usr/share/terminfo
from a newer Mac that has fresh install of Lion and does not exhibit this problem.Now, even though
echo $TERM
still yieldsxterm-256color
, vi and less now work fine.不知何故,有时“terminfo”文件夹在全新安装后会损坏。
我不知道为什么,但问题可以这样解决:
希望它有帮助。
somehow and sometimes "terminfo" folder comes corrupted after a fresh installation.
i don't know why, but the problem can be solved in this way:
hope it helps.
我的案例非常独特,但这可以帮助某人。在 Android 上,我尝试将 nano 从 termux 二进制文件夹复制到 /system/xbin。将所有库依赖项放在 /system/lib 中并收到此错误。我从 termux 复制的 libncurses.so.6 文件的 TERMINFO 文件仍然指向 /data/data/com.termux/files/usr/share/terminfo
查看指向的路径
使用命令字符串 path-to-libncurses.so | grep /terminfo
要修复,请使 termux terminfo 目录和子目录可由 nano 用户读取和执行,或者将 terminfo 文件夹复制到其他位置并使用十六进制编辑器修改共享库文件中的纯文本路径。
链接到压缩的 terminfo 文件夹
https://drive.google.com/file/d/1m1tfHgkGRehBGh1jPMK4EaTgQb9EyCG7/view?usp=drivesdk
Mine was quite a unique case but this could help someone. On Android I tried to copy nano from my termux binary folder to /system/xbin. Placed all the library dependencies in /system/lib and got this error. The libncurses.so.6 file I copied from termux had it's TERMINFO file still pointed to /data/data/com.termux/files/usr/share/terminfo
View pointed path with command
strings path-to-libncurses.so | grep /terminfo
To fix either make the termux terminfo dir and subdirs readable and executable by the nano user or copy the terminfo folder somewhere else and use a hexeditor to modify the plain text path in the shared library file.
Link to zipped terminfo folder
https://drive.google.com/file/d/1m1tfHgkGRehBGh1jPMK4EaTgQb9EyCG7/view?usp=drivesdk
我听说这个问题可以通过用安装了正常运行的 Lion 的人的计算机上的信息覆盖您的
/usr/share/terminfo
来解决。我无法确认这是否有效,不幸的是我还没有升级,所以我无法向您提供该文件。I hear that this can be fixed by overwriting your
/usr/share/terminfo
with one from the computer of somebody with a working install of Lion. I can't confirm whether this works or not, and unfortunately I haven't upgraded yet, so I can't provide you with that file.您可以在 .bashrc 中添加以下内容
You can add the following in your .bashrc
根据 @Meetai.com 提供的链接,这在 linux mint 上对我有用。
将其放入
.bashrc
中并重新启动终端:TERM="xterm"
出口期限
This worked for me on linux mint, based on the link provided by @Meetai.com.
Put this in
.bashrc
and restart the terminal:TERM="xterm"
export TERM
当 ssh 到另一台计算机时遇到此问题。登录后设置 TERM 对我有用。显然 ssh 会将 TERM 环境变量传递到新终端。
导出术语=xterm
Had this problem when ssh into another computer. Setting TERM after logging in worked for me. Apparently ssh will pass the TERM environment variable to the new terminal.
export TERM=xterm