纳米错误:打开终端时出错:xterm-256color

发布于 2024-11-25 13:27:33 字数 262 浏览 2 评论 0原文

安装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

小猫一只 2024-12-02 13:27:33

升级到 OSX Lion 后,我开始在某些(Debian/Ubuntu)服务器上收到此错误。修复方法很简单,安装“ncurses-term”包,它提供文件 /usr/share/terminfo/x/xterm-256color。

这在 Ubuntu 服务器上对我有用,通过 Erik Osterman< /a>.

After upgrading to OSX Lion, I started getting this error on certain (Debian/Ubuntu) servers. The fix is simply to install the “ncurses-term” package which provides the file /usr/share/terminfo/x/xterm-256color.

This worked for me on a Ubuntu server, via Erik Osterman.

原谅过去的我 2024-12-02 13:27:33

我可以确认这是一个 terminfo 问题。这对我有用。通过 SSH 连接到远程计算机并运行

 sudo apt-get install ncurses-term

Boom。问题解决了。

I can confirm this is a terminfo issue. This is what worked for me. SSH in to the remote machine and run

 sudo apt-get install ncurses-term

Boom. Problem solved.

隐诗 2024-12-02 13:27:33
  1. 编辑您的.bash_profile文件

    vim .bash_profile

  2. commnet

    #export TERM=xterm-256color

  3. 添加此

    导出 TERMINFO=/usr/share/terminfo

    导出 TERM=xterm-basic

    在您的.bash_profile

  4. 终于

    运行:

    source .bash_profile

  1. edit your .bash_profile file

    vim .bash_profile

  2. commnet

    #export TERM=xterm-256color

  3. add this

    export TERMINFO=/usr/share/terminfo

    export TERM=xterm-basic

    to your .bash_profile

  4. finally

    run:

    source .bash_profile

太傻旳人生 2024-12-02 13:27:33

我通过 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 to VT-100.

I also marked Delete Sends Ctrl-H because this Mac connection was confusing zsh.

It appears to be working for my use case.

冬天旳寂寞 2024-12-02 13:27:33

我在升级到 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 yields xterm-256color, vi and less now work fine.

虐人心 2024-12-02 13:27:33

不知何故,有时“terminfo”文件夹在全新安装后会损坏。
我不知道为什么,但问题可以这样解决:

1. Download Lion Installer from the App Store
2. Download unpkg: http://www.macupdate.com/app/mac/16357/unpkg
3. Open Lion Installer app in Finder (Right click -> Show Package
Contents)
4. Open InstallESD.dmg (under SharedSupport)
5. Unpack BSD.pkg with unpkg (Located under Packages)   Term info
will be located in the new BSD folder in /usr/share/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:

1. Download Lion Installer from the App Store
2. Download unpkg: http://www.macupdate.com/app/mac/16357/unpkg
3. Open Lion Installer app in Finder (Right click -> Show Package
Contents)
4. Open InstallESD.dmg (under SharedSupport)
5. Unpack BSD.pkg with unpkg (Located under Packages)   Term info
will be located in the new BSD folder in /usr/share/terminfo

hope it helps.

冰火雁神 2024-12-02 13:27:33

我的案例非常独特,但这可以帮助某人。在 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

跨年 2024-12-02 13:27:33

我听说这个问题可以通过用安装了正常运行的 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.

獨角戲 2024-12-02 13:27:33

您可以在 .bashrc 中添加以下内容

if [ "$TERM" = xterm ]; then TERM=xterm-256color; fi

You can add the following in your .bashrc

if [ "$TERM" = xterm ]; then TERM=xterm-256color; fi
三月梨花 2024-12-02 13:27:33

根据 @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

夜唯美灬不弃 2024-12-02 13:27:33

当 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文