diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-10-05 20:19:01 +0100 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-10-05 20:19:01 +0100 |
commit | bff62fa21fe8d7b2cd8e93dc54be3b07f8b89dfc (patch) | |
tree | 225ab70b14578fa96bf5dbb470daadf6785b24b2 | |
parent | 9b3e1ffc65e3b2e7be0c72ca4091636fe003e3a8 (diff) | |
download | infra-bff62fa21fe8d7b2cd8e93dc54be3b07f8b89dfc.tar.gz infra-bff62fa21fe8d7b2cd8e93dc54be3b07f8b89dfc.tar.bz2 infra-bff62fa21fe8d7b2cd8e93dc54be3b07f8b89dfc.zip |
Make screenrc compatible with screen 5.0.0 version
GNU Screen does not support colors specification as letters anymore.
Here is relevant quote from manpage:
> The old format of specifying colors by letters (k,r,g,y,b,m,c,w) is
> now deprecated.
And by deprecated they mean doesn't work anymore.
Unfortunately, macOS ships screen version 4.00.03 and I couldn't figure
out a way to have screenrc syntax to work on both 5.0 and 4.0 versions
at the same time.
One more problem is `screen --version` changed return code, so even code
for checking if screen is installed at all doesn't work anymore. Need
to figure out a proper way forward. For now I just installed screen
version 5.0.0 from homebrew to fix macOS setup and at the same time make
Linux machines happy as well.
-rw-r--r-- | misc/dotfiles/screenrc.j2 | 8 | ||||
-rw-r--r-- | roles/dotfiles/tasks/main.yml | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/misc/dotfiles/screenrc.j2 b/misc/dotfiles/screenrc.j2 index acc934a..f7c9c07 100644 --- a/misc/dotfiles/screenrc.j2 +++ b/misc/dotfiles/screenrc.j2 @@ -19,18 +19,18 @@ term xterm altscreen on # Always display windows captions with the following format. -# %{Wb}: bright white letters on blue background. +# %{255;4}: bright white letters on blue background. # %H: hostname of the system. # %c: current time HH:MM in 24h format. -# %{wk}: white letter on black background. +# %{7;0}: white letter on black background. # %-w: all window numbers and names up to the current window. -# %{kw}: black letters on white background. +# %{0;7}: black letters on white background. # [%n %t]: window number and window title. # %{-}: restores the attributes and colors that were set before the last change # was made. # %+w: all window numbers and names starting with the window after the current # one. -caption always "%{Wb} %H - %c %{wk} %-w%{kw}[%n %t]%{-}%+w" +caption always "%{255;4} %H - %c %{7;0} %-w%{0;7w}[%n %t]%{-}%+w" # Enable visual bell. vbell off diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml index f34335f..36445e2 100644 --- a/roles/dotfiles/tasks/main.yml +++ b/roles/dotfiles/tasks/main.yml @@ -53,8 +53,7 @@ ansible.builtin.template: src: misc/dotfiles/screenrc.j2 dest: ~{{ user }}/.screenrc - # For some reason screen's exit status is 1 for --version. - when: has_screen.rc == 1 + when: has_screen.rc == 0 - name: Configure ssh if installed tags: ssh |