Can tmux sessions be persistent to disk?

2013-01-28 Thread Thiago Padilha
Hello all I've started using tmux today but I liked it so much that I'm already integrating it into my workflow. Currently I use vim sessionman plugin to resume my work after shutting down the computer. Is it possible to achieve a similar effect using tmux sessions? In other words, can I resume

Any advice on how to achieve this?

2013-01-29 Thread Thiago Padilha
Hello I'm using tmux both locally and on my remote server, but I would prefer not to use the server session nested inside my local tmux session. I would like to automatically detach my local tmux session whenever I enter the ssh command, and reattach to it when I disconnect from the server. Ano

Re: Any advice on how to achieve this?

2013-01-29 Thread Thiago Padilha
ssh, > something like: > > #!/bin/sh > > tmux set status off > tmux set prefix ^P > ssh "$@" > tmux set -u prefix > tmux set -u status > > > > On Tue, Jan 29, 2013 at 08:21:13AM -0300, Thiago Padilha wrote: > >Hello > >I'm

Binding keys to shell commands

2013-01-30 Thread Thiago Padilha
Hi I have a shell function that accepts a pane id as argument. This function works fine when invoked interactively: $ shell_function $TMUX_PANE I would like to invoke this function from any pane, running a interactive shell or not, by binding this function to a key combination, however I can't f

Re: Binding keys to shell commands

2013-01-30 Thread Thiago Padilha
Thanks for the patch. What feature is your work on hook-support going to add? Any idea when you will merge it? On Wed, Jan 30, 2013 at 10:11 PM, Thomas Adam wrote: > On Wed, Jan 30, 2013 at 09:42:24PM -0300, Thiago Padilha wrote: > > Hi > > > > I have a shell function t

Re: Binding keys to shell commands

2013-01-30 Thread Thiago Padilha
Nvm, got it from your github mirror On Wed, Jan 30, 2013 at 10:52 PM, Thiago Padilha wrote: > Thanks for the patch. > > What feature is your work on hook-support going to add? Any idea when you > will merge it? > > > > > On Wed, Jan 30, 2013 at 10:11 PM, Thomas Adam

Re: Your recipe on achieving this simple workflow

2013-02-21 Thread Thiago Padilha
lob/master/tmux.conf#L86-L88 > > I too am curious if there are better ways to do the things I'm doing. You > mentioned using a shared memory server, I'm not familiar w/ that, do you > have an example? > > Thanks, > > Aaron > > On Thursday, February 21,

Re: Your recipe on achieving this simple workflow

2013-02-21 Thread Thiago Padilha
things I > needed in my script. It would be nice to have something like that. Are there > plans to get that into tmux proper? > > On Thursday, February 21, 2013 at 10:16 PM, Thiago Padilha wrote: > > Since I wanted a 'lightweight' solution that I could carry arrou

Re: Your recipe on achieving this simple workflow

2013-02-22 Thread Thiago Padilha
> > I plan on submitting my hook patches instead which obsolete this. > Since we're also talking about improvements in tmux scripting let me throw a few ideas that would greatly boost tmux scripting capabilities: 1 - Shared memory support through a tmux command. Something like zsh 'zstyle' comman

Re: Your recipe on achieving this simple workflow

2013-02-22 Thread Thiago Padilha
On Fri, Feb 22, 2013 at 6:18 AM, Thomas Adam wrote: > > This is just implementation, but you could use Redis for this, independent > of anything in tmuz. > True, but I think its a bit of overkill having to install redis on every machine I have to use my tmux scripts, which is why I implemented a

Re: Your recipe on achieving this simple workflow

2013-02-22 Thread Thiago Padilha
Nicholas, I have applied the patch and compiled, how do I test it? -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_

Re: Your recipe on achieving this simple workflow

2013-02-22 Thread Thiago Padilha
Worked perfectly, thanks. I have also tried tmux 'resize-pane -Z' but it didn't work, perhaps you need to fix the description of the argument to -z? On Fri, Feb 22, 2013 at 9:37 AM, Nicholas Marriott wrote: > C-b z > --

Implementing some extra features

2013-02-22 Thread Thiago Padilha
There are some features I feel are missing in tmux: 1- Shared key value storage tmux shm set KEY VALUE # set a value tmux shm get KEY VALUE [DEFAULT] # gets a value if exists, or set and return a default value, if provided(in one atomic operation) tmux shm pop KEY # pops a value 2- Sha

Re: Implementing some extra features

2013-02-22 Thread Thiago Padilha
On Fri, Feb 22, 2013 at 10:30 AM, Nicholas Marriott wrote: > For the first of these you can already use the tmux global environment > or use user options which were added very recently you only need to > worry about the second. > Nice to know about user options. Even so, I think it still misses th

Re: Your recipe on achieving this simple workflow

2013-02-22 Thread Thiago Padilha
On Fri, Feb 22, 2013 at 12:57 PM, Nicholas Marriott wrote: > Here is the latest in case anyone wants to run with it for a while > before I decide whether or not to commit it :-). > What's wrong with it? -- Everyone hates

Re: Implementing some extra features

2013-02-22 Thread Thiago Padilha
Added '-o' to set-option, which will only take effect when the value isn't set yet. So far only added for user options. I assumed the server runs a single thread, is that right? If not some kind of synchronization is needed on the region that tests if the value is set. On Fri, Feb 22, 2013 at 1

[PATCH] Implemented -o option for 'set-option'

2013-02-22 Thread Thiago Padilha
This option alters 'set-option' behavior so it will only set the value if it isn't already set --- cmd-set-option.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/cmd-set-option.c b/cmd-set-option.c index a09e6db..28105d8 100644 --- a/cmd-se

Re: [PATCH] Implemented -o option for 'set-option'

2013-02-22 Thread Thiago Padilha
Anyone knows how I can use gmail to send this? On Fri, Feb 22, 2013 at 3:35 PM, Thiago Padilha wrote: > This option alters 'set-option' behavior so it will only set the value if > it isn't already set > --- > cmd-set-option.c | 34 +

Re: Implementing some extra features

2013-02-22 Thread Thiago Padilha
I had forgotten to update the man pages to reflect the nem flag, this patch contains the complete thing. set-option-2.patch Description: Binary data -- Everyone hates slow websites. So do we. Make your web apps faster wit

Re: Implementing some extra features

2013-02-22 Thread Thiago Padilha
Ok by me, I was just following the existing code :) So the patch is good to merge? Need me to do any other modifications? On Fri, Feb 22, 2013 at 6:50 PM, Nicholas Marriott wrote: > On Fri, Feb 22, 2013 at 06:34:14PM -0300, Thiago Padilha wrote: >> I had forgotten to update the man

[PATCH] Expand variables in the run-shell command string

2013-02-23 Thread Thiago Padilha
Let's say I want to write a shell script that operates on the currently focused pane, to be executed with 'run-shell'. The only way to do that for now is to call 'tmux list-panes' inside the script and parse the output to determine the active pane. This patches modifies run-shell to expand tmux #{v

Re: [PATCH] Expand variables in the run-shell command string

2013-02-23 Thread Thiago Padilha
Ok here is the updated patch --- cmd-if-shell.c | 20 ++-- cmd-run-shell.c | 18 ++ tmux.1 | 10 -- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/cmd-if-shell.c b/cmd-if-shell.c index 6f0b151..011974f 100644 --- a/cmd-if-shell.c +

Re: Implementing some extra features

2013-02-23 Thread Thiago Padilha
hanges thanks > > > On Fri, Feb 22, 2013 at 07:14:30PM -0300, Thiago Padilha wrote: > > Ok by me, I was just following the existing code :) > > > > So the patch is good to merge? Need me to do any other modifications? > > > > On Fri, Feb 22, 2013 at 6:50 PM, Nich

Re: Implementing some extra features

2013-02-23 Thread Thiago Padilha
n-shell it > should be clear enough. > > > On Sat, Feb 23, 2013 at 09:55:43PM +, Nicholas Marriott wrote: > > On Sat, Feb 23, 2013 at 06:24:56PM -0300, Thiago Padilha wrote: > > >I have started to read the source code and began to wonder if those > > >

[PATCH] Implementation of the 'monitor' command

2013-02-25 Thread Thiago Padilha
Command that provides features for all synchronization needs in tmux scripts. I added an example script that serves a temporary documentation and shows the features provides by displaying a simple 'animation' which integrates multiple panes. I can see two issues with the current implementation:

Re: [PATCH] Implementation of the 'monitor' command

2013-02-26 Thread Thiago Padilha
ge it to TAILQ which sould be a drop-in replacement. On Tue, Feb 26, 2013 at 5:04 AM, Thomas Adam wrote: > On Mon, Feb 25, 2013 at 09:27:24PM -0300, Thiago Padilha wrote: > > Command that provides features for all synchronization needs in tmux > scripts. > > I can't apply

Re: [PATCH] Implementation of the 'monitor' command

2013-02-26 Thread Thiago Padilha
This one refactors the previous patch to use event loop when shifting monitors. I have tested it now and it seems to be working alright, I guess I have done something wrong the first time I tried this. --- monitor.c | 32 ++-- tmux.h| 1 + 2 files changed, 31 inser

Re: [PATCH] Implementation of the 'monitor' command

2013-02-26 Thread Thiago Padilha
I expressed myself badly. I meant using your commit as a model for organizing my code, not base the work on it. This patch contains the refactored version and it should be possible to apply on current master --- Makefile.am | 2 + cmd-monitor.c | 110

Re: [PATCH] Implementation of the 'monitor' command

2013-02-26 Thread Thiago Padilha
Ok, can you give me a hint/example on how I might listen for a client exit so I can remove the node associated with the monitor? On Tue, Feb 26, 2013 at 10:56 AM, Thomas Adam wrote: > On Tue, Feb 26, 2013 at 10:50:58AM -0300, Thiago Padilha wrote: > > I expressed myself badly. I me

Re: [PATCH] Implementation of the 'monitor' command

2013-02-26 Thread Thiago Padilha
Here is TAILQ version of the patch, along with the event loop diff(which randomly crashes the server for me again) --- Makefile.am | 2 + cmd-monitor.c | 110 cmd.c | 1 + examples/monitor.sh | 120 ++ monitor

Re: [PATCH] Implementation of the 'monitor' command

2013-03-03 Thread Thiago Padilha
Here's a nice integration between vim and tmux for any zsh users that want to give this patch a try: https://gist.github.com/tarruda/5051527 Combined with the new zoom patch, you can get a nice 'toggle top terminal' experience. On Tue, Feb 26, 2013 at 11:37 AM, Thiago Padilha wr

Re: [PATCH] Implementation of the 'monitor' command

2013-03-05 Thread Thiago Padilha
yself, so I was hoping for some feedback/help If you guys want I can recreate the patch against the current master. On Sun, Mar 3, 2013 at 7:53 PM, Thiago Padilha wrote: > Here's a nice integration between vim and tmux for any zsh users that want > to give this patch a try: https:/

Re: [PATCH] Implementation of the 'monitor' command

2013-03-05 Thread Thiago Padilha
me, I don't like "monitor", but we can > worry about that later. > > > On Tue, Mar 05, 2013 at 09:47:45AM -0300, Thiago Padilha wrote: > >Any chance this patch will be accepted? > >I still need to tweak a few things: > >- Detect when a waiting p

Re: [PATCH] Implementation of the 'monitor' command

2013-03-05 Thread Thiago Padilha
Ok, I your idea is simpler and it should work. mine was just a proof of concept actually. I would like to get this on the next version(already using on my scripts) but I'm kinda busy to reimplement right now so I will probably do it on weekend. Do you any idea when you will freeze tmux 1.8 feature

Re: [PATCH] Implementation of the 'monitor' command

2013-03-05 Thread Thiago Padilha
Ok, this week I will implement it About the command, do you prefer two separate commands for locking/unlocking and waiting signaling? What name(s)/parameters should the commands have? Should I use a separate file for defining the tree/global variables(like I did with the monitor.c file) I think

[PATCH] Implement 'wait-for' command

2013-03-05 Thread Thiago Padilha
Here it goes: The first patch implements wait/signal, the second extends it with lock/unlock. My goal this time was to make the code small and simple as possible, let me know if you think anything needs to be refactored. --- Makefile.am | 1 + cmd-wait-for.c| 145 +

Re: [PATCH] Implement 'wait-for' command

2013-03-06 Thread Thiago Padilha
gt; +.Fl S > +with the same channel. > +This command only works from outside > +.Nm . > .El > .Sh TERMINFO EXTENSIONS > .Nm > diff --git a/tmux.h b/tmux.h > index c1ad662..e58c1de 100644 > --- a/tmux.h > +++ b/tmux.h > @@ -1416,6 +1416,8 @@ struct cmd_q { >

Re: [PATCH] Implement 'wait-for' command

2013-03-06 Thread Thiago Padilha
Yes will do in a minute On Wed, Mar 6, 2013 at 6:58 AM, Nicholas Marriott wrote: > Committed, thanks. Do you want to tweak the lock bits to fit too? > > > On Wed, Mar 06, 2013 at 06:53:12AM -0300, Thiago Padilha wrote: >> This looks good to me >> >> On Wed, Ma

Re: [PATCH] Implement 'wait-for' command

2013-03-06 Thread Thiago Padilha
Do you want me to add the example script? On Wed, Mar 6, 2013 at 7:09 AM, Thiago Padilha wrote: > Yes will do in a minute > > On Wed, Mar 6, 2013 at 6:58 AM, Nicholas Marriott > wrote: >> Committed, thanks. Do you want to tweak the lock bits to fit too? >> >> &g

Re: [PATCH] Implement 'wait-for' command

2013-03-06 Thread Thiago Padilha
Here it is. My first patch contains a example shell script in case you want to add. --- cmd-wait-for.c | 81 ++ tmux.1 | 12 ++--- 2 files changed, 85 insertions(+), 8 deletions(-) diff --git a/cmd-wait-for.c b/cmd-wait-for.c inde

Hidden pane sometimes 'leaking' output into zoomed window

2013-03-06 Thread Thiago Padilha
I could not find the exact conditions that cause this, but here certain facts about my workflow 1- split window with top pane running shell or node.js server web server 2- bottom pane running vim, which is most of the time zoomed 3- when I edit and save a file in vim, a background watcher process

Re: Hidden pane sometimes 'leaking' output into zoomed window

2013-03-07 Thread Thiago Padilha
> way it can happen. Can you try to come up with an easier way to > reproduce? > > > On Wed, Mar 06, 2013 at 11:37:55AM -0300, Thiago Padilha wrote: >> I could not find the exact conditions that cause this, but here >> certain facts about my workflow >> >> 1-

Re: Copying between buffer and clipboard

2013-03-12 Thread Thiago Padilha
Here's how I do it: # move x clipboard into tmux paste buffer bind C-p run "tmux set-buffer \"$(xclip -o -selection clipboard)\"; tmux paste-buffer" # move tmux copy buffer into x clipboard bind C-y run "tmux show-buffer | xclip -i -selection clipboard" On Tue, Mar 12, 2013 at 1:13 PM, James Jong

Re: Any way to have scripted session exits?

2013-03-17 Thread Thiago Padilha
tmux sessions I guess it makes sense to provide a way for the user to script the cleanup. On Sun, Mar 17, 2013 at 9:59 AM, Thiago Padilha wrote: > Is it possible for me to run a script or do some cleanup when a > session is about to exit? eg: send write/quit commands to vim > insta

Re: Any way to have scripted session exits?

2013-03-18 Thread Thiago Padilha
Adam wrote: > On 18 March 2013 03:44, Thiago Padilha wrote: >> After reading the code a little bit, I'm guessing this is not possible >> at the moment. >> >> Nicholas, what are your thoughts about adding another option to the >> new-session command, one that

Re: Any way to have scripted session exits?

2013-03-18 Thread Thiago Padilha
> Hi > > Hooks will initially only do things before and after commands but we > will add other hooks later - this can be one of them. > > > On Mon, Mar 18, 2013 at 08:11:09AM -0300, Thiago Padilha wrote: >> >From what I understood by reading the hook-support email,

Re: Any way to have scripted session exits?

2013-03-18 Thread Thiago Padilha
That's nice, let me know if I can help you in any way On Mon, Mar 18, 2013 at 1:28 PM, Thomas Adam wrote: > On Mon, Mar 18, 2013 at 01:23:30PM -0300, Thiago Padilha wrote: >> I just read through the hook-support thread, but it hasn't been >> updated in a few months. >

Re: Change in 'shell-command' behavior?

2013-03-19 Thread Thiago Padilha
You can probably do somethine like this instead: (cd ~/tmp; CSE=1 tmux new-session -d -s misc -n context '/bin/bash -l') On Tue, Mar 19, 2013 at 8:02 AM, Vladimir Lomov wrote: > Hello, > > I experience some problem with 'git://git.code.sf.net/p/tmux/tmux-code' > git repository, 'tmux' compiled f

Re: Compiling tmux as non-root user

2013-03-19 Thread Thiago Padilha
Install development packages for ncurses using your distro package manager. If you are using a recent version of ubuntu or debian enter the following: sudo apt-get install libncurses5-dev libevent-dev On Tue, Mar 19, 2013 at 11:02 AM, Jai Dayal wrote: > Thanks for the reply. Here's what it says

Suggestion: conditional mappings

2013-04-07 Thread Thiago Padilha
Hi It would be nice to have a tmux command that conditonally send keys based on the program running in the focused pane. See a use case with hacky workaround here: https://gist.github.com/tarruda/5158535 In the example, vim-tmux-move.zsh will navigate between tmux panes, but if the current pane

Tmuxer, a tmux script manager

2013-11-03 Thread Thiago Padilha
Hi I've just released tmuxer(https://github.com/tarruda/tmuxer), a command-line tool for managing initialization/shutdown of tmux session. It is implemented in POSIX compliant shell scripts so it should run in most UNIX systems(though I've only tested on ubuntu) I encourange anyone interested in