As outlined in [this
gist](https://gist.github.com/bbqtd/a4ac060d6f6b9ea6fe3aabe735aa9d95)
the version of `ncurses` shipped with macOS is too old to be aware of
the `tmux-256color` terminal info database which is the default in
`tmux`. This patch downloads the latest `ncurses` terminal info database
and uses that to install the `tmux-256color` entry for the current user
in `~/.terminfo`. This ensures that bold, italic, etc, are working
correctly and `git` does not throw warnings as noted
[here](1e2c00aa32
)
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
---
|
|
- name: install homebrew packages
|
|
homebrew:
|
|
name:
|
|
- tmux
|
|
- osx-cpu-temp
|
|
- reattach-to-user-namespace
|
|
- urlview
|
|
state: latest
|
|
|
|
- name: check terminal info description exists
|
|
command: /usr/bin/infocmp -x tmux-256color
|
|
changed_when: false
|
|
failed_when: false
|
|
register: terminfo_exists
|
|
|
|
- name: download latest terminal info descriptions
|
|
when: terminfo_exists.rc == 1
|
|
get_url:
|
|
url: https://invisible-island.net/datafiles/current/terminfo.src.gz
|
|
dest: ~/terminfo.src.gz
|
|
|
|
- name: extract latest terminfo info descriptions
|
|
when: terminfo_exists.rc == 1
|
|
command: /usr/bin/gunzip ~/terminfo.src.gz
|
|
|
|
- name: compile terminal info
|
|
when: terminfo_exists.rc == 1
|
|
command: /usr/bin/tic -xe tmux-256color ~/terminfo.src
|
|
|
|
- name: cleanup downloaded terminal info descriptions
|
|
when: terminfo_exists.rc == 1
|
|
file:
|
|
path: '{{item}}'
|
|
state: absent
|
|
with_items:
|
|
- ~/temrinfo.src.gz
|
|
- ~/terminfo.src
|
|
|
|
- name: check terminal info description exists
|
|
when: terminfo_exists.rc == 1
|
|
command: /usr/bin/infocmp -x tmux-256color
|
|
changed_when: false
|
|
register: terminfo_exists
|