Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear command doesn't work with OS X 10.10.3: "unknown terminal type" #1368

Closed
ijstokes opened this issue Jun 9, 2015 · 10 comments
Closed
Labels
locked [bot] locked due to inactivity

Comments

@ijstokes
Copy link

ijstokes commented Jun 9, 2015

I have a brand new Mac Book Pro with very little customization. I have Anaconda 2.2.0 and conda info -a reports:

             platform : osx-64
        conda version : 3.13.0
  conda-build version : 1.11.0
       python version : 2.7.10.final.0

The clear command does not work properly for me:

petawawa:tmp ijstokes$ clear
'xterm-256color': unknown terminal type.

petawawa:tmp ijstokes$ which clear
/Users/ijstokes/anaconda/bin/clear

petawawa:tmp ijstokes$ ls -Fla `which clear`
-rwxr-xr-x  2 ijstokes  staff  8644 Oct 21  2014 /Users/ijstokes/anaconda/bin/clear*

I am about to rename it so I get my system clear back, but I thought I would report this behavior first.

@asmeurer
Copy link
Contributor

asmeurer commented Jun 9, 2015

Looks like an issue with my ncurses package.

@asmeurer
Copy link
Contributor

asmeurer commented Jun 9, 2015

This should be fixed. conda update ncurses.

@asmeurer asmeurer closed this as completed Jun 9, 2015
@mtbirdsall
Copy link

I am trying to use clear with a fresh install of anaconda2 on XOS. The issue is that I can't clear the terminal screen. Not a problem I can get by without it. I installed ncurses and that didn't seem to change my plight. This the stout from clear:

-bash: /Users/user/anaconda2/bin/clear: No such file or directory

FYI -
I am new to using terminal as consistently as I have over the last 3 months (i.e. I am sure that I can update a $PATH but I am not sure exactly how I would, should do it, or if I can fix this using another method like updating).

@mtbirdsall
Copy link

Kenobi-Wan:~ mbirdsall$ conda info -a

             platform : osx-64
        conda version : 3.19.0
  conda-build version : 1.18.2
       python version : 2.7.11.final.0
     requests version : 2.9.1
     root environment : /Users/mbirdsall/anaconda2  (writable)
  default environment : /Users/mbirdsall/anaconda2
     envs directories : /Users/mbirdsall/anaconda2/envs
        package cache : /Users/mbirdsall/anaconda2/pkgs
         channel URLs : https://repo.continuum.io/pkgs/free/osx-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/osx-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : None
    is foreign system : False

Kenobi-Wan:~ mbirdsall$ which clear

/usr/bin/clear

Kenobi-Wan:~ mbirdsall$ ls -Fla 'which clear'

ls: which clear: No such file or directory

@gawbul
Copy link

gawbul commented Dec 8, 2016

I'm having the same issue on an install of Miniconda2 - has the ncurses bug resurfaced?

cc @blink1073 re ContinuumIO/anaconda-issues#331

I get the following output:

$ clear
terminals database is inaccessible

Something is conflicting in the path, because if I append (instead of prepend) the miniconda bin directory, then clear works fine, but then everything else in the path is taking precedence.

Same issue here, but this doesn't solve for me ContinuumIO/anaconda-issues#994

@gawbul
Copy link

gawbul commented Dec 8, 2016

Doing the following fixed for me, so definitely something with the ncurses package again.

$ conda remove ncurses 
Fetching package metadata .............
Solving package specifications: ..........

Package plan for package removal in environment /home/gawbul/miniconda2:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    fastx_toolkit-0.0.14       |                0         496 KB  bioconda

The following packages will be REMOVED:

    gnuplot:       5.0.4-ncurses5.9_0 bioconda
    ncurses:       5.9-8              r       

The following packages will be DOWNGRADED due to dependency conflicts:

    fastx_toolkit: 0.0.14-2           bioconda --> 0.0.14-0 bioconda

Proceed ([y]/n)? 

@chenqifeng92
Copy link

chenqifeng92 commented Dec 12, 2017

Terminal.app is setting the TERM environment variable according to the menu entry, so exporting it does not address the problem. (Setting TERM has no effect on the behavior of Terminal.app, but that is a different mattern).

OSX (and most Unix-like) systems use terminfo for finding terminal information. If the environment variable TERMINFO is set, the ncurses library uses that path in preference to the compiled-in location (which is supposed to match the installed-location).

Your shell may have set the TERMINFO variable (for instance, by copying settings from another machine). Removing it from the shell initialization (such as ~/.profile or ~/.bashrc) is a way to fix that.

Alternatively, you may (as in tput: unknown terminal “xterm-256color”) have installed some not-mentioned package which conflicts with the ncurses libraries on the system. In that discussion, it seems that someone built ncurses libraries which had compiled-in default for TERMINFO to a non-existent location. For that case, I pointed out that the OP could set TERMINFO to tell the broken libraries where to find the terminal database. That is,

export TERMINFO=/usr/share/terminfo

would be a first step.

@PKHG
Copy link

PKHG commented Apr 3, 2019

macbook clear works again after adding below in .bash_profile
export TERMINFO=/usr/share/terminfo

Finally ;-)

@nleroy917
Copy link

I ran into this today on OSX's Z Shell (ZSh). (I've had so many issues with Zshell since upgrading to Catalina). Setting TERMINFO as an environment variable

export TERMINFO=/usr/share/terminfo

works, but obviously is only temporary - as @PKHG suggested, adding to your ~/.profile makes the fix permanent - but for Z shell, instead of the ~/.bash_profile you should use ~/.zshrc.

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

7 participants