I'm using tmux for the first time as a replacement for iterm (mostly because of the split panels function) and it works great. Now, i have a question about the copy-text behaviour.
It's possible to configure tmux, so i can select text with the left button (in copy mode) and it's automatically copied (to the clipboard) when i release the left button? (same as in irc clients)
Tmux’s select behavior will depend on your mouse settings. If mode-mouse is off, Tmux should stay out of the way. But, by default, it may be set to “on”. Then it will use its own “paste buffer”. To bypass that, you can hold down shift while selecting and pasting. (This works on Linuxes, but probably on Mac, too; not sure what OS you’re on.)
Related
If I run tmux with synchronized panes, I can type and have the text appear in all panes at the same time.
Furthermore, if I use the mouse to select text and copy it into the system clipboard, I can paste and have it appear in all panes.
However, if I want to use tmux native copy (prefix-[) and paste (prefix-]), the pasted content appears in only one pane.
Is there a native tmux way to paste in all panes of the current window?
There is no native tmux way so far to achieve it. Because pasting buffer is calling paste-buffer command. It can only be applied on a single pane, with the optional -t.
Your system clipboard approach worked because you were using the send-key (I guess) in key mapping.
What you can try is, if you have synchronized panes, you type in one pane: tmux pasteb, you will see that this command was typed in all panes, however the result/output comes only to your current pane.
In new versions of tmux, I know that I can use set -g mouse on to enable mouse support in order to be able to resize panes with the mouse.
But it also enable a feature that I do not want which is using copy mode when I select text in the terminal. In that way I am no more able to copy text in the system clipboard in order to paste it outside of tmux.
My question is: is there a way to enable resizing panes with the mouse, which very handy, without having to enable mouse support for other things?
Because there in no answer, I will try to answer myself:
Apparently there is no way to do this, since when a mouse event is intercepted by tmux, it cannot be forwarded to the system. I say this but it is pure deduction, I have no knowledge about that.
As an alternative, there is a way to prevent tmux to intercept the mouse, by holding a key like "fn" on Mac OS.
I've installed arch linux x64 on my computer. I added other user. Also I added this new user to common groups. When I type startxfce4 by root, xfce4 runs properly and it's possible to use it. But when I type startxfce4 by newly added user xfce4 also runs. But instead default mouse in background I can see black screen, can't see cursor. Panels are visible. After call "turn off" dialog (I can't see cursor, but panels are working and I can see if cursor is on a button of the panel) cursor appearances. If the cursor hovers panels it's ok. But if this cursor is over background I can see big cross cursor like in checking of working xorg-server. When I run su before executing startxfce4 xfce4 also doesn't work correctly. What did I forget during install xorg-server, xfce4 or during adding new user?
Answer is here. In a nutshell the problem was xfwm4 wasn't running, I forgot do that. I typed xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -sa xfwm4 and it worked.
I generally use tmux with 3-4 panes open. One of these panes is rarely used, so I'd be happy to hide it away somewhere. I suppose I could do this in a new window, but I'd rather hide it "behind" an existing pane.
For example, I'd like to keep rails server running in the background because I rarely need to refer to it, so guard occupies that pane instead. When I need to look at the rails server output, I'll switch to the guard pane and then "tab" over to the rails server.
At least, that's the ideal situation, but I can't figure out how to achieve it.
Tmux currently does not provide the functionality of 'hiding' panes.
For now, the closest tmux comes to hiding panes is the 'pane zoom' functionality. It is toggled with prefix + z. When 'on', the pane is resized to 100% of the window and all the other panes are hidden. Setting the pane zoom to 'off' unhides the hidden panes.
That said, I think the 'zoom' functionality is not ideal for your use case. Other have pointed it out: just using a new window that doesn't get in your way might do the trick and is a simple solution.
You should be able to do this using break-pane and join-pane - see this question on Unix&Linux.
i am not sure what is in your mind of the concept "tab"; however, from what you want, a window is more than enough.
Imagine you have a "tab" in tmux, then, you more or less have to switch to that tab in order to see the output, so, the operation is exactly the same with window of tmux.
Normally, I type <c-x> c to have a new window, and then go back to the main workspace (the previous window) with <c-x> p and open my vim there to work. I might have multiple panes on my main workspace with tmux pane (not with vim pane, cos i need to have the terminal always to navigate). Then after I change things, save, just type another <c-x> p to go to the server and see what happen there
(note that I bind <c-b> to <c-x>)
I'm trying to create a visual indicator of which pane is currently focused in tmux when my terminal (iterm2, OSX) window gains focus. I have found that iterm2 sends a focus gained escape sequence (^[[I) so now I am trying to find how I can capture that and fire the prefix q command which shows pane numbers with the active pane in red.
Any ideas on how to capture the escape sequence in tmux OR in iterm2?
I have a partial solution to my issue which takes a different approach. Since I usually have vim and one terminal pane open, dimming vim when it is not focussed is a good indicator which pane is active. In order to achieve this I have modified the vim-diminactive plugin to react to focus events (https://github.com/blueyed/vim-diminactive/pull/8), this requires the Vitality.vim plugin as well as enabling (focus-events) in tmux options.
In order to completely solve my issue I am working on changing the background colour of terminal panes when they lose focus. I use zsh so I can capture the focus event with bindkey (I have verified this works) to issue a background colour change escape code to iterm2, however this seems to have no effect in tmux.