Kitty: tmux; open terminal failed: can't find terminfo database

Created on 10 Mar 2018  ยท  22Comments  ยท  Source: kovidgoyal/kitty

Installed with homebrew brew cask install kitty

OS = macOS 10.12.6

โ””โ”€ 1 0 0 $ tmux attach -d
open terminal failed: can't find terminfo database
โ””โ”€ 1 0 0 $ tmux -V
tmux 2.6

โ””โ”€ 1 0 0 $ kitty --version
Failed to set locale with LANG: en_DK.UTF-8
kitty 0.8.1 created by Kovid Goyal

โ””โ”€ 1 0 0 $ env | grep TERM
COLORTERM=truecolor
...
TERM=xterm-kitty
TERMINFO=/Applications/kitty.app/Contents/Frameworks/kitty/terminfo

โ””โ”€ 1 0 0 $ infocmp
#       Reconstructed via infocmp from file: /Applications/kitty.app/Contents/Frameworks/kitty/terminfo/78/xterm-kitty
xterm-kitty|KovIdTTY,

...

kitty.conf; minus newlines and commented lines

font_family      Fira Code
italic_font      auto
bold_font        auto
bold_italic_font auto
font_size        13.0
font_size_delta 2
adjust_line_height 0
adjust_column_width -2
box_drawing_scale 0.001, 1, 1.5, 2
background_opacity 0.8
url_style curly
cursor_shape     block
cursor_blink_interval     0.5
cursor_stop_blinking_after 15.0
scrollback_lines 2000
scrollback_pager less +G -R
wheel_scroll_multiplier 5.0
click_interval 0.5
shell .
mouse_hide_wait 3.0
focus_follows_mouse no
enabled_layouts *
remember_window_size   yes
initial_window_width   640
initial_window_height  400
repaint_delay    10
input_delay 3
sync_to_monitor yes
visual_bell_duration 0.5
enable_audio_bell no
open_url_modifiers ctrl+shift
open_url_with default
rectangle_select_modifiers ctrl+alt
allow_remote_control yes
term xterm-kitty
window_border_width 1
window_margin_width 0
window_padding_width 0
inactive_text_alpha 1.0
tab_bar_edge top
tab_separator " โ”‡"
active_tab_font_style bold-italic
inactive_tab_font_style normal
map ctrl+shift+v        paste_from_clipboard
map ctrl+shift+s        paste_from_selection
map ctrl+shift+c        copy_to_clipboard
map shift+insert        paste_from_selection
map ctrl+shift+o        pass_selection_to_program
map ctrl+shift+up        scroll_line_up
map ctrl+shift+down      scroll_line_down
map ctrl+shift+k         scroll_line_up
map ctrl+shift+j         scroll_line_down
map ctrl+shift+page_up   scroll_page_up
map ctrl+shift+page_down scroll_page_down
map ctrl+shift+home      scroll_home
map ctrl+shift+end       scroll_end
map ctrl+shift+h         show_scrollback
map ctrl+shift+enter    new_window
map ctrl+shift+n        new_os_window
map ctrl+shift+w        close_window
map ctrl+shift+]        next_window
map ctrl+shift+[        previous_window
map ctrl+shift+f        move_window_forward
map ctrl+shift+b        move_window_backward
map ctrl+shift+`        move_window_to_top
map ctrl+shift+1        first_window
map ctrl+shift+2        second_window
map ctrl+shift+3        third_window
map ctrl+shift+4        fourth_window
map ctrl+shift+5        fifth_window
map ctrl+shift+6        sixth_window
map ctrl+shift+7        seventh_window
map ctrl+shift+8        eighth_window
map ctrl+shift+9        ninth_window
map ctrl+shift+0        tenth_window
map ctrl+shift+right    next_tab
map ctrl+shift+left     previous_tab
map ctrl+shift+t        new_tab
map ctrl+shift+q        close_tab
map ctrl+shift+l        next_layout
map ctrl+shift+.        move_tab_forward
map ctrl+shift+,        move_tab_backward
map ctrl+shift+equal    increase_font_size
map ctrl+shift+minus    decrease_font_size
map ctrl+shift+backspace restore_font_size
map ctrl+shift+f11      toggle_fullscreen
map ctrl+shift+u        input_unicode_character
map ctrl+shift+e        run_simple_kitten text url_hints
copy_on_select no
macos_titlebar_color system
macos_hide_titlebar no
macos_option_as_alt yes
x11_bell_volume 80

Most helpful comment

Found it. https://github.com/tmux/tmux/issues/743

I had a previous tmux session active from Terminal.app.
Once I killed that, all was well.

Thanks again!

All 22 comments

Since infocmp is able to load the terminfo database, that is a bug in tmux. Though, at least on linux, with up-to-date versions of tmux, it is able to laod kitty's terminfo database just fine. Try updating your tmux, and if that does not fix it, report the bug to the tmux developers.

Okay. I installed HEAD from the tmux repository, and I still get the same error message. I'll try with the tmux devs. Thanks.

Found it. https://github.com/tmux/tmux/issues/743

I had a previous tmux session active from Terminal.app.
Once I killed that, all was well.

Thanks again!

I've got the same problem here and noticed that I could run one tmux session simultaneously on several terminal emulators (terminal.app, iTerm, alacritty), but not the kitty.

It is true that killing tmux server and running it from kitty first - solved the problem, so I could attach other terminals to it without an issue. But kitty was still failing to start tmux if session was created from another terminal emulator.
So I've decided to try to change TERM variable in kitty.conf from specific 'xterm-kitty' to, as I believe, more general 'xterm-256color', and that completely solved that issue.

But of course i've noticed that note in tmux.conf that says to better think twice before changing this variable, so I'm interested in what can go wrong from now on? And do I really did the right thing here... Because I assume that it was purposely set to kitty. Can you please explain that to me?

UPD:
I've found that page with a rich explanations about colors, I'll leave it here

The terminfo file is used for everything from keybindings to various terminal capabilities. Depending on how mismatched your terminfo file and your terminal is and what capabilities the application you are running uses, anything from key presses to colors to scrolling may or may not work.

I just ran into this issue as well and found https://github.com/tmux/tmux/issues/743#issuecomment-275473980 which lead me to restart my tmux session, which ended up helping.

Could it be that the cause was that the tmux session was created prior to installing kitty? I'm not really sure how terminfo works and if there's some global registration that happens at the time kitty is installed.

If it's of any relevance, I'm on OS X with tmux 2.7.0. Also tried updating to HEAD which didn't help. Killing all existing sessions did.

You cannot re-use tmux sessions across different terminal emulators. That's a limitation of tmux. terminfo is s simply key value database file that is located and read via the TERM and TERMINFO env vars. Since tmux presumbaly reads it when the session is first created, changing it later by using a different terminal is going to case issues.

@kovidgoyal you can re-attach from OS X terminal into iterm2 and vice versa. What you are saying is NOT true. You can even attach to the same session from terminal AND iterm at the same time if you want. This is clearly something that needs to be fixed in kitty IMHO.

If the two terminals have the same terminfo, then sure you can reattach, since as far tmux is concerned they are the same terminal. If they dont, then you cannot.

I was able to attach to the same tmux session from alacritty, iTerm, terminal. Was not able via Kitty: open terminal failed: can't find terminfo database

FYI I had this issue because I'd installed Kitty in a manner that did not install its terminfo into the normal location (I used the linux package method and then copied the contents to /usr/local. Running sudo ln -s /usr/local/lib/kitty/terminfo/x/xterm-kitty /usr/share/terminfo/x/xterm-kitty solved my problem.

because they all pretend to be xterm and so use the same terminfo database.

Instead of linking to /usr/share/terminfo/x/xterm-kitty, you can also link to ~/.terminfo/x/xterm-kitty, that should also work. Or set the TERMINFO environment variable to the terminfo directory.

sorry guys, linking these didn't work for me on mac 10.12.6

Can confirm: I got the same error when running tmux from brew on Mojave. It was another running tmux session that caused the error.

Can confirm: I got the same error when running tmux on MacOS Catalina 10.15.4 Beta (19E234g)

For anyone finding this on google: I had a similar issue with tmux (not kitty related). When I detached from my running tmux session, I couldn't subsequently re-attach, with the same error message: open terminal failed: can't find terminfo database.

  • MacOS Mojave (10.14.6)
  • tmux 3.0a
  • Terminal.app

Turns out homebrew had upgraded ncurses (from 6.1_1 to 6.2) from underneath my running tmux server process, and deleted the folder for the previous ncurses under /usr/local/Cellar/ncurses.

I restored /usr/local/Cellar/ncurses/6.1_1 from a backup, and was then able to tmux att again.

Here was my workaround:

cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/
git log master -- Formula/ncurses.rb\
git checkout 512634eea3553d0afaea549cfb5385d15c047b7e. [this is the 6.1_1]
HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall ncurses

For anyone finding this on google: I had a similar issue with tmux (not kitty related). When I detached from my running tmux session, I couldn't subsequently re-attach, with the same error message: open terminal failed: can't find terminfo database.

  • MacOS Mojave (10.14.6)
  • tmux 3.0a
  • Terminal.app

Turns out homebrew had upgraded ncurses (from 6.1_1 to 6.2) from underneath my running tmux server process, and deleted the folder for the previous ncurses under /usr/local/Cellar/ncurses.

I restored /usr/local/Cellar/ncurses/6.1_1 from a backup, and was then able to tmux att again.

same, except restoring didn't work. I had to (sadly) kill my session through looking up its process number in order to start a new one.

bigsmelly's solution also didn't work for me, though it did revert versions properly

@benw01 thx!
recovery has not worked for me, but i was able to create a symlink with

ln -s /usr/local/Cellar/ncurses/6.2 /usr/local/Cellar/ncurses/6.1_1

@luetkit thank you linking worked for me

I have also met this issue with kitty 0.17.2 and tmux 3.1b. If I create a session in alacritty, I can not attach to this session or create new session in kitty. However, if I initially create a new session (before that, there is not tmux session running) in kitty, I can attach to that session or create a new session in Alacritty.

The TERM env for kitty and Alacritty is xterm-kitty and xterm-256color respectively.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jomik picture Jomik  ยท  4Comments

reed-jones picture reed-jones  ยท  4Comments

JJGO picture JJGO  ยท  3Comments

drandreaskrueger picture drandreaskrueger  ยท  4Comments

metalelf0 picture metalelf0  ยท  4Comments