While using `tmux-256color` has been working great for the longest time,
`git` on macOS Venture with Apple Silicon does not like it. Complaints
of incorrectly configured terminal are resolved in this config by
removing this custom termdb entry. Alternative would be to install it
again but it doesn't seem to be necessary anymore.
Using `xclip` or `xsel` in WSL2 started causing Windows GUI applications
to hang when pasting from the clipboard set by `xclip`/`xsel` waiting on
input from a clipboard process which had already exited. When WSL is
detected, use `win32yank.exe` instead. This is available via Chocolatey
but is also shipped with the Neovim Windows installation.
For more context, see https://github.com/microsoft/terminal/issues/11945
Update the `system-info` directory with the addition of a `systemd`
service file and an new Linux script to display current CPU temperature
and core/thread utilization. Update `.conduit.yaml` with addition
`apt` dependencies `sysstat` and `jq`. Update the install and remove
scripts to setup and tear down the `systemd` user unit. Lastly, decrease
the `tmux` status line update interval from 5 to 2 seconds.
The `system-info` directory contains scripts and configuration files to
install and remove a `launchd` user agent on macOS which collects
information about the system and outputs it to the file
`~/.cache/tmux/system-info`. This file is then read periodically by
`tmux` and the contents displayed in the status line.
For pagers such as `less` which don't support terminal mouse features
enable scrolling with the mouse wheel by emulating the behaviour using
`send-keys -t= {up,down}` when in alternate (fullscreen) mode.
These bindings retain the expected behaviour when using programs which
do support terminal mouse events and copy-mode.
Sometimes when yanking large blocks of text from a pane larger than its
size in copy mode did not work. Switch to using `xclip` from `xsel` to
see if this works better.
Make using the `@vim$TMUX_PANE` window flag much more robust by
unsetting it every time the zsh prompt is drawn and setting it again
using a `FocusGained` `autocmd` in vim. This removes the need for the
hacky check for zsh in the conditional defined in the `in_vim` variable.
Fixes#6 by setting a window option called `vim$TMUX_PANE` during vim
setup, and removing it when vim exits:
```vim
if $TMUX !=# ''
" Set tmux window option to detect when to change pane.
let s:tmux_option = '@vim'.substitute($TMUX_PANE, '%', '\\%', 'g')
call system('tmux set-window-option '.s:tmux_option.' 1')
au VimLeave * call system('tmux set-window-option -u '.s:tmux_option)
endif
```
Then update the `is_vim` conditional shell statement to check if this
variables exists for the current pane to determine when to change tmux
pane or pass through the binding to vim.
```conf
in_vim='[[ "$(tmux show-window-options)" = *"@vim#{pane_id}"* ]] && \
[[ "#{pane_current_command}" != zsh ]]'
```
Additionally check if the vim task has been backgrounded by comparing
the value of `#{pane_current_command}`, this is likely a bit brittle if
backgrounding is used heavily but works otherwise.
Use iTerm2 proprietary escape sequence for changing cursor shape per
pane. Apps like vim or zsh should emit VTE compatible escape sequences
for this to work.