3

Looking for a way to control text/cursor highlighting colors when in vi-mode in tmux. I can not seem to find many answers from googling around. I love tmux and use this feature quite a bit, and I have been living with this flaw for some time and still have not been able to find a solution. You can view my dotfiles here. Keep in mind that my master branch is my OSX setup, and I have an "arch" branch for my Arch linux setup. The issues occurs on both systems. Though the colors are slightly different, but not by much.

Here is current symptoms: (both systems) I am in a tmux session, I want to enter into vi-mode for either searching or copying some text. When copying text (hitting v while in vi-mode for visual) the highlighted text and background are both black. So I can't see the text I am highlighting. Or while searching (hit "/" while in vi-mode for searching) my background and text on the entire line where my prompt is for typing the text I want to search is all black. So I have no idea what text is actually in the search. If I mis-type something due to fat fingers and nothing returns in my search, it can be frustrating. One last symptom (which is a minor one, but would be nice to solve) When I do search, I get absolutely no highlighting over than my normal cursor. Not like my vim set up where it highlights currently found, and all other matches.

Here is what the desired fix would look like: Searches would highlight in some shade of yellow or orange on all matched text. Searching prompt to type in search text would be at least readable. Anything but Black on Black. Highlighting text while selecting what to copy in visual mode again anything readable, no Black on Black.

Other things to note: I typically have mouse-mode on in tmux to promote keyboard-driven approach and not allow any selection of text via mouse selection. But when I do toggle this feature off and can then select text via mouse, the highlighted text background is white and text is black. While readable, would still wish to know how to control this color as well. Also (not sure any vim settings actually carry over to tmux) but everything works as desired while actually in vim. Just in case vim settings here. Same note about branches.

Most of my tools are latest versions afaik. This includes Tmux 2.1. I do not have full list of versions of my tools as of right now. If this may play a part in debugging let me know and I'll reply with versions. For what its worth other tools that might be in conflict is my shell I use zsh with on-my-zsh. On my mac I am using iTerm2, on arch I'm using URxvt. Doubt any of my .Xresources matter since it also happens on OSX.

Any help is greatly appreciated. Thanks in advance.

Byron Mansfield
  • 613
  • 1
  • 6
  • 19
  • Terminal text-cursor coloring isn't something that *tmux* itself would deal with. The separate terminal emulators may have (as iTerm2 has for "smart cursor color") some setting that helps maintain a good contrast versus the text/background. – Thomas Dickey Jan 02 '16 at 00:11
  • @ThomasDickey Thanks for the confirmation. That is good to know. As part of my struggle with resolving this is I am unsure as what level is controlling this. The terminal, tmux, OS, etc. Though I guess I was narrowing it down to a tmux issue cause it was the only commonality between both my setups. So you think that I probably need to configure something at the terminal level? I'll do some research on solutions for both. Thanks again. – Byron Mansfield Jan 02 '16 at 00:33
  • 1
    As an update, still does not quite give me 100% of what I was looking for. But at least highlighting in vi-mode inside tmux in iTerm2 and URxvt. I posted it to a few other places where the question was asked such as http://unix.stackexchange.com/a/252887/149742. It is at least now readable when I am searching or highlighting. Here is the change I made in my dotfiles repo https://github.com/byronmansfield/dotfiles/commit/ee0c869808953f27557a5771b6103a25ee6bdac7. If anyone knows how to improve on this to make the searching more like vim please let me know. – Byron Mansfield Jan 02 '16 at 18:50

0 Answers0