There's no universal way to do this, since each program handles this differently, but vim has a client-server mode that might satisfy your needs in this particular instance.
Firstly, start vim in server mode:
vim --servername foo
Now you can open files in that instance of vim from elsewhere:
vim --servername foo --remote-tab file
This requires having a vim
version compiled with +clientserver
. On Debian, the vim-gnome
package contains a version of vim with client-server functionality. Some other distributions have similar packages.
There is some information on 256-color support in the tmux FAQ.
Detecting the number of colors that the terminal supports is unfortunately not straightforward, for historical reasons. See Checking how many colors my terminal emulator supports for an explanation. This means that
- tmux cannot reliably determine whether the terminal supports more than 8 colors;
- tmux cannot reliably communicate to the application that it supports more than 8 colors.
When you're in tmux, the terminal you're interacting with is tmux. It doesn't support all of xterm's control sequences. In particular, it doesn't support the OSC 4 ; …
control sequence to query or set color values. You need to use that while directly running in xterm, outside tmux.
If you run tmux -2
, then tmux starts with 256-color support, even if it doesn't think that your terminal supports 256 colors (which is pretty common).
By default, tmux advertises itself as screen
without 256-color support. You can change the value of TERM
in .tmux.conf
to indicate 256-color support:
set -g default-terminal "screen-256color"
You can use TERM=xterm-256color
or TERM=screen-256color
on Ubuntu. These values will only cause trouble if you log in to a remote machine that doesn't have a termcap/terminfo entry for these names. You can copy the entries to your home directory on the remote machine; this works with most modern terminfo implementations.
# From the Ubuntu machine to a machine that doesn't have *-256color terminfo entries
ssh somewhere.example.com mkdir -p .terminfo/s .terminfo/x
scp -p /lib/terminfo/s/screen-256color somewhere.example.com:.terminfo/s/
scp -p /lib/terminfo/x/xterm-256color somewhere.example.com:.terminfo/x/
Best Answer
You can get a list of "screens" with Ctrl+B w. This shows the main program running without any options, so that help a bit but not much.
You should name your screens with Ctrl+B , after you make them, that will make that list much more useful.
This is what I get after Ctrl+B w, you can select the entry with ↑ and ↓ followed by Return, or by clicking with the mouse.