SBT Error: “Failed to construct terminal; falling back to unsupported…”

后端 未结 10 800
别跟我提以往
别跟我提以往 2020-12-13 03:20

I have run into an ERROR with SBT today. It can best be shown with the sbt sbt-version command:

Run on 5/29/17:

eric@linux-x2vq:~$ sbt s         


        
相关标签:
10条回答
  • 2020-12-13 03:46

    I had the same issue, especially when the TERM environment variable is set to xterm-256color. Setting it to a different value fixed the issue for me, e.g.

    export TERM=xterm-color
    
    0 讨论(0)
  • 2020-12-13 03:50

    I found the package which causes this issue: ncurses. I downgraded ncurses to version ncurses-6.0+20170429-1 (I am using Arch Linux) and SBT starts just fine.

    Steps for Arch Linux:

    cd /var/cache/pacman/pkg
    sudo pacman -U ncurses-6.0+20170429-1-x86_64.pkg.tar.xz # or some other older version
    

    Steps for Mac: see https://github.com/jline/jline2/issues/281

    I think this issue was introduced with ncurses version 20170506, see: http://invisible-island.net/ncurses/NEWS.html#index-t20170506

    + modify tic/infocmp display of numeric values to use hexadecimal when
          they are "close" to a power of two, making the result more readable.
    

    I filed an issue on the SBT issue tracker: https://github.com/sbt/sbt/issues/3240

    Edit: SBT version 0.13.16 includes the fix for this problem.

    0 讨论(0)
  • 2020-12-13 03:52

    One year passed... now it happened to me.


    So, ncurses did change, and the corresponding sbt part was ...I guess... probably only implemented based on random guessed tests and observations/bugs and not any spec nor RFC. (So far, sbt is the only program with this ncurses issue that I know of.)

    In case you can't simply upgrade sbt nor downgrade ncurses, you could change the TERM environment variable as mentioned in the other answers.

    trivial fix:

    If your sbt script is some bash script (most likely, unless you run DOS' .bat files)

    $ file /usr/bin/sbt
    /usr/bin/sbt: Bourne-Again shell script, ASCII text executable
    

    , then it might suffice to add this workaround:

    TERM="${TERM/xterm-256color/xterm-color}"
    
    0 讨论(0)
  • 2020-12-13 03:56

    I can't write a comment as my score is too low, but user3113045's answer worked when I added export TERM=xterm-color to my .zshrc file

    0 讨论(0)
  • 2020-12-13 04:01

    For Ubuntu 20.04 Users, Open your terminal and run the bellow CMDs

    • Go to this "/usr/share/sbt/bin" directory ( $ cd /usr/share/sbt/bin )
    • give the permission to edit file ( $ sudo chmod -R 777 sbt )
    • Open the sbt text file in this directory ( $ nano sbt )
    • Add this "export TERM=xterm-color" cmd in top and save ( Ctrl + X )

    Ex:-

    #!/usr/bin/env bash
    export TERM=xterm-color
    set +e
    
    0 讨论(0)
  • 2020-12-13 04:05

    sbt command is just a script. It load $HOME/.sbtconfig at the very beginning, so just put

    export TERM=xterm-color
    

    as @user3113045 said in the conf file, sbt will work. In that case your other term commands will still use xterm-256color.

    0 讨论(0)
提交回复
热议问题