Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Italics and the default terminal choice #205

Closed
jetzerb opened this issue Nov 27, 2018 · 5 comments
Closed

Italics and the default terminal choice #205

jetzerb opened this issue Nov 27, 2018 · 5 comments

Comments

@jetzerb
Copy link

jetzerb commented Nov 27, 2018

I use the bat utility in place of cat and/or less.

When used within tmux, though, it was rendering a lot of reverse text. Turns out that's due to a deficiency in the "screen" based terminals, and the reverse text was supposed to be italics.

Sure enough, if I follow the advice from the tmux FAQ and set the default terminal to "tmux", the italics and reverse text are rendered correctly. In my very limited amount of usage since I made the change, I haven't noticed any problems when using "tmux" terminal rather than the "screen-256color" used here.

Looks like the initial commit of .tmux.conf back in 2012 used "screen-256color" and it's just been that way ever since. Perhaps it's time for an update?

@gpakosz
Copy link
Owner

gpakosz commented Nov 27, 2018

Hello @jetzerb

Thanks for porting this to my attention.

Considering the amount of support I do for people who don't set TERM properly outside and inside tmux, I would prefer to stay conservative and keep screen-256color in .tmux.conf.

That being said, I believe having the reference .tmux.conf.local file showing off

# Use tmux terminal description if you want to use italics 
# set -g default-terminal "tmux"

What do you think?

@jetzerb
Copy link
Author

jetzerb commented Nov 27, 2018

Yes, that's a good compromise. In fact, when I initially edited .tmux.conf.local, I was more than half expecting to see such a comment.

One thing I noticed though: if I use `CTRL-A e' to edit my configuration, and update the default terminal, it doesn't fully change the behavior.

  • TERM environment variable is updated
  • bat renders text in italics rather than reverse
  • But when I search for text in the pager, the search terms render in italics instead of reverse. If I tmux detach and then start a new tmux session with the updated terminal in place, bat correctly renders both italics and reverse text.

It appears to be an issue with tmux itself, and not Oh My Tmux!. When I start a new session with no .tmux.conf file at all, and then CTRL-B : followed by set -g default-terminal "tmux" I see the same behavior.

@gpakosz
Copy link
Owner

gpakosz commented Dec 2, 2018

It may be too early for it to be a default choice.

Here's Vim 8.1 (2018 May 18, compiled Oct 29 2018 06:56:05) launching inside tmux 2.8 on macOS High Sierra:

E558: Terminal entry not found in terminfo
'tmux' not known. Available builtin terminals are:
    builtin_amiga
    builtin_beos-ansi
    builtin_ansi
    builtin_pcansi
    builtin_win32
    builtin_vt320
    builtin_vt52
    builtin_xterm
    builtin_iris-ansi
    builtin_debug
    builtin_dumb
defaulting to 'ansi'

@BenKettlewell
Copy link

Encountered the same problem. I went with

  7 set -as terminal-overrides ',xterm*:sitm=\E[3m'

And so far no issues.

@gpakosz
Copy link
Owner

gpakosz commented Oct 19, 2021

Hi there 👋

I pushed the gh-205-382 branch that uses tmux-256color when available.

ulken94 added a commit to ulken94/.tmux that referenced this issue Oct 28, 2021
* improved status line rendering, fixes gpakosz#419 (2)

- do not apply attr to spacers
- fixed attr for last window, window with activity and window with bell

* added support for #{hostname_full} and #{hostname_full_ssh}, closes gpakosz#361

* fixed use of invalid 'print' command

* improved status line rendering, fixes gpakosz#419 (3)

fixed spacers

* fixed indentation in _apply_overrides()

* mention 'reattach-no-usernamespace' is not needed for tmux > 2.6

* added support for tpm, resolves gpakosz#61

* fixed BusyBox's tr command compatibility, fixes gpakosz#441

* fixed variable replacement in tmux_conf_theme_status_right and tmux_conf_theme_status_left, fixes gpakosz#356

* fix left status prefix rendering

* fixed variable replacement in tmux_conf_theme_status_right and tmux_conf_theme_status_left (2), fixes gpakosz#442

* fixed #{online} custom variable implementation as ping -t is not portable, fixes gpakosz#451

* remind people to not "uncomment" local functions in .tmux.conf.local

* fixed copy to os clipboard on macOS when xclip or xsel is installed, fixes gpakosz#459

* worked around broken /sys/class/power_supply/<supply_name>/capacity > 100, resolves gpakosz#460

* made version detection more robust in case tmux executable is renamed (2), fixes gpakosz#457

* made version detection more robust in case tmux executable is renamed (3), fixes gpakosz#462

fixed a regression introduced by commit 8aefa1e that breaks
version detection for tmux HEAD for which 'tmux -V' prints e.g. tmux next-3.3

* made _apply_bindings() work with tmux 3.2 stock bindings, fixes gpakosz#472

* replaced printf '\n' calls by echo calls, fixes gpakosz#479

TPM plugins further editing status-left or status-right may alter the content
in such a way that the line feed character becomes a space

* use single quotes for strings containing Unicode escapes, fixes gpakosz#486

* mitigate tmux displaying its "<... not ready>" message, closes gpakosz#496

the "flickering" perceived when the "<... not ready>" message is long won't be
totally eliminated until tmux 3.3 though (commit 38c5788232e0e3abdd08ade55a9d4fbcda637df1)

* revert "mitigate tmux displaying its "<... not ready>" message, closes gpakosz#496"

this reverts commit 67b1d38.

the proposed mitigation causes flickering for some, see followups in gpakosz#496

* check connectivity to github.com before installing and/or updating tpm and plugins, fixes gpakosz#513

* fixed _battery_info() when pmset doesn't report a charge percentage, fixes gpakosz#512

* updated tpm integration

- automatically delete tpm when not used
- automatically delete unused plugins
- install plugins when subsequently enabling then in ~/.tmux.conf.local
- use <prefix> + u to update plugins as <prefix> + U is bound to Urlview, fixes gpakosz#507

* fixed tpm plugins not installing on CentOS 7, fixes gpakosz#520

- drop git clone --shallow-submodules as it requires git >= 2.9.0
- display a message when one of the tpm script fails

* worked around Falcon.app agent slowing everything down, fixes gpakosz#492

it appears the Falcon anti-malware product for end-points slows down ps -t /dev/ttysXXX
commands 🤷

the workaround consists in passing ttysXXX instead of /dev/ttysXXX and is achieved
by removing the /dev/ prefix in #{pane_tty} expansion with the help of formats
substitutions

* worked around Falcon.app agent slowing everything down (2), fixes gpakosz#522

* reworked pane / tty introspection, fixes gpakosz#403, fixes gpakosz#458

- renamed _tty_info() to _pane_info()
- pass both #{pane_pid} and #{pane_tty} to _pane_info()
- when inspecting ps output, walk down from #{pane_pid} to the child-most pid

* made background sleep process exit immediately when exiting tmux, fixes gpakosz#509

* set default-terminal to tmux-256color when available, fixes gpakosz#205, fixes gpakosz#382, closes gpakosz#386

see https://github.com/tmux/tmux/wiki/FAQ#i-dont-see-italics-or-italics-and-reverse-are-the-wrong-way-round

* check connectivity to github.com before installing and/or updating tpm and plugins (2)

Co-authored-by: Gregory Pakosz <gregory.pakosz@gmail.com>
Co-authored-by: Frederick Zhang <frederick888@tsundere.moe>
Co-authored-by: Neil Mahoney <neiljosephmahoney@gmail.com>
Co-authored-by: Haneol Kim <hekim@jmarple.ai>
tunght13488 added a commit to tunght13488/.tmux that referenced this issue Nov 17, 2021
* upstream/master: (46 commits)
  updated _username() in when the ssh client doesn't support %r in ProxyCommand
  updated _ssh_or_mosh_args()
  improved _pane_info() accuracy by excluding ssh proxy connections, tee, and only considering the first child of a process
  updated tpm integration to display a message when one or more plugin(s) fails to run, closes gpakosz#533
  made background sleep process exit immediately when exiting tmux (2)
  worked around Falcon.app agent slowing everything down (3)
  do not unset @tpm-install, @tpm-update, @tpm-clean and @plugin variables after tpm has launched, fixes gpakosz#531
  reworked pane / tty introspection (3)
  added word boundaries when replacing uptime_xxx variables (2)
  reworked pane / tty introspection (2)
  added support for arguments to custom variables defined in ~/.tmux.conf.local
  added word boundaries when replacing uptime_xxx variables
  check connectivity to github.com before installing and/or updating tpm and plugins (2)
  set default-terminal to tmux-256color when available, fixes gpakosz#205, fixes gpakosz#382, closes gpakosz#386
  made background sleep process exit immediately when exiting tmux, fixes gpakosz#509
  reworked pane / tty introspection, fixes gpakosz#403, fixes gpakosz#458
  worked around Falcon.app agent slowing everything down (2), fixes gpakosz#522
  worked around Falcon.app agent slowing everything down, fixes gpakosz#492
  fixed tpm plugins not installing on CentOS 7, fixes gpakosz#520
  updated tpm integration
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants