On Sun, May 29, 2011 at 04:23, Helmut Schneider <jumpe...@gmx.de> wrote:
snip
> I have a script, more a wrapper, that checks for screen and sudo and if
> neither screen or sudo are active the script is restarted using screen
> and/or sudo:
>
snip

I have found a setup like this to work:

in ~/func:

function tmuxify {
        if [[ -z "$TMUX" ]]; then
                command=""
                for arg in "$@"; do
                        command="$command '$arg'"
                done
                exec tmux new "$command"
        fi
}

In the shell script you want to run in tmux

#!/bin/bash

source ~/func

tmuxify $0 "$@"

echo $1
echo $2
echo hit enter
read;

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to