Tag Info

Hot answers tagged

3

Yes you can, but it has a bit verbose syntax and you should use only short commands. But if you quote it the right way you might be able to post anything. Here just a hello command: for i in `seq 2 3`; do tmux send-keys -t 1:2.$i -l 'hello '; done This sends to Session 1, Window 2, Pane 2 and 3. You can find out about the sessions, windows and panes with ...


3

You don't want to overwrite your bash. You want tmux only for interactive sessions and you don't want to do it recursively like in the other answer. Simple example taken from [1], with common use case where you try to attach last session, which can be useful. This should go into your ~/.bashrc. echo Checking for tmux if [ -z ${TMUX} ]; then /usr/bin/tmux ...


2

Try executing this inside your tmux session: tmux display-message -p '#S'


1

You need to set default-command: set -g default-command /usr/local/bin/zsh default-shell variable only use to create a login shell, when default-command is empty - which is default value. Or you can simply change your default shell to zsh, in this case, tmux will start a login shell, instead of non-login shell.


1

I may misunderstand what you are trying to do but if your aim is to move the process with PID 7969 into tmux then you can achieve it by running reptyr inside tmux: $ tmux send-key -t mysession:mywindow "reptyr 7969^M" That runs reptyr INSIDE the tmux session in the shell window at mysession:mywindow. If you need to create the session first: $ tmux new -d ...


1

With tmux list-client, you can list all clients connected to tmux sessions. For instance: $ tmux list-client /dev/pts/6: 0 [25x80 xterm] (utf8) /dev/pts/8: 0 [25x80 xterm] (utf8) From this point, you can choose to detach a specified client, or all clients of a specified session. Say I want to detach everyone connected to session 0: $ tmux detach-client ...


1

You'll have spaces at the end of the line when selecting and copying from the terminal if the application displayed spaces at that spot. Applications may display spaces in order to erase what was there before. Terminals have commands to delete a whole line or delete characters to the right of the cursor; applications choose between that and displaying spaces ...


1

Copy & pasting from a terminal screen is never going to be fully reliable because it's dealing with screen output instead of original source material. If some applications echo text to the terminal in an unusual fashion and it results in the terminal not being able to guess what the original text was, there's probably not much you or the terminal can do ...


1

In your .tmux.conf file located in your user's home directory you can change or add keyboard shortcuts to your tmux sessions. If this file doesn't exist you can just create it. There are lots of sample .tmux.conf files around the web and several good gists out there. If all you want to do is make comma or dot cycle to previous or next window add the ...


1

As you're already using it, I'd recommend tmux as fully supports copy and paste - see the manual page for more information. You can see the current key bindings by using the tmux list-keys command - look for the begin-selection, copy-selection and paste-buffer commands in that list. By default, the bindings are: [ - Start copy/paste mode h, j, k, l - vi ...


1

Aside from using a control code to manually restart, you might consider using a system which is specifically designed to automate this kind of procedure, that is, (re)starting a process after code changes, such as watchman. You could also use inotifywait (from inotify-tools) to notify when a file representing source code changes, and send a signal when it ...


1

If you do not want to use loops your choices are limited as it essentially precludes just automatically restarting you program again and again. Still you can at least cut out the step with ↑ by using the accept-and-hold widget. This runs the current command line (just like accept-line which is usually bound to Enter) but also pushes it onto the buffer ...



Only top voted, non community-wiki answers of a minimum length are eligible