1

When I try to use emacs -nw inside a tmux pane under iterm2, the cursor is invisible. This behavior is present regardless of which theme I use in iterm2.

I'm using emacs version 24.5 on Mac OS X 10.9.5 and running tmux under iterm2 (using the default terminal emulator the cursor is visible). Is there a way to configure either tmux, emacs, or iterm2 so that the cursor is white?

3 Answers 3

2

I had the same problem with the following:

  • iTerm2 2.1.1
  • tmux 2.0
  • Emacs 24.5.1

The problem is reported in this issue: https://github.com/tmux/tmux/issues/22, which claims that the issue is fixed in github.

One comment mentions the following tmux config, which worked perfectly for me (ensure you restart tmux daemon):

set -ag terminal-overrides ',screen*:cvvis=\E[34l\E[?25h'

The issue is also reported for iTerm2 here: https://gitlab.com/gnachman/iterm2/issues/3539.

0
2

For me, I am using iterm2 version 3.1.4. If you go to Preferences -> Profiles -> Colors, and check the Smart Cursor Color tickbox, it change the color of the cursor depending on the background color.

1
  • Wow I use the terminal all day every day and I never took the 5 minutes to look this up and do it. Gah!
    – JZL003
    Jan 17 at 4:43
0

The first place I would check would be if it provides similar features to xterm (which can do this). In a quick check, iTerm2 does not implement any of xterm's controls for coloring the cursor. But (quoting from its documentation) iTerm2 supports a cursor-coloring feature (as an option) which (like xterm) does what you want:

To tune smart cursor color settings:

defaults write com.googlecode.iterm2.plist SmartCursorColorBgThreshold -float 0.5 
defaults write com.googlecode.iterm2.plist SmartCursorColorFgThreshold -float 0.75

SmartCursorColorBgThreshold: If the cursor's background color is too close to nearby background colors, force it to the "most different" color. This is the difference threshold that triggers that change. 0 means always trigger, 1 means never trigger.

SmartCursorColorFgThreshold: The cursor's text is forced to black or white if it is too similar to the background. If the brightness difference is below a threshold then the B/W text mode is triggered. 0 means always trigger, 1 means never trigger.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .