Tag Info

New answers tagged

0

Thanks for your answers, guys! It looks like my problem was solved even as I was asking the question. JuiceSSH just released an update which fixes the enter key problem. https://juicessh.com/changelog The July 25 JuiceSSH update "Fixed enter key in Nano when using the latest version of Google Keyboard" seems to be the solution to my problem. I found the ...


0

I think you want: stty -icrnl ...though that seems a little strange to me. It's my understanding that apple systems default to a \return line-ending, but on all of my linux systems a default stty sane terminal will do exactly the opposite and translate input carriage returns newlines. Your Android device and my linux systems share a system kernel - which ...


0

If the phone literally emits c-j, then no, the only solution is to change the binding in tmux-navigator. And I think ssh is purely byte-based. (You can also send unix signals e.g. like ctrl+c / interrupt, but that's it). It's able to work because your phone tells the ssh server it's using c-j as newline when the session opens. RFC 4254 - The Secure Shell ...


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 ...


0

I think it is not possible to set Meta/Ctrl solely as a prefix for tmux. As for Super key, you need to set up both your tmux and terminal emulator as Super is X key and tmux works on shell. This answer explains better. I recommend to set the prefix to something like Ctrl-a or Ctrl-s then simply bind , and . to move through windows. # remap prefix unbind ...


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 ...


0

You should be able to comment lines with a # character. It may be that this character has to start a line and entries like set ... # setting a new value are not allowed.


0

As per the manual page Users can create a list of windows to launch at startup in $BYOBU_CONFIG_DIR/windows and $BYOBU_CONFIG_DIR/windows.tmux. This file is the same syntax as ~/.screenrc and ~/.tmuxrc, each line specifying a window, as described in screen(1) or tmux(1) The standard comment character in a tmux configuration ...


0

I like to do this: #!/bin/bash function tmuxed { /usr/local/bin/tmux new-session -d -s bkp 2&>/dev/null /usr/local/bin/tmux send-keys "/Users/xxx/bin/thisscript backup" C-m } function backup { echo 'bla bla doing stuff' } $1 And run /Users/xxx/bin/thisscript tmuxed


2

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


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 ...


0

Are you speaking of launching tmux from your bash configuration file? In that case, you should launch tmux by preceding it by the keyword exec: exec tmux ... in order to have bash being fully replaced by tmux.


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 ...


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 ...


0

Ah - I didn't intend to answer my own, but I just found a good enough solution for me. Since I never need the § key anyway, and I use backticks a fair bit - marking code here for example! - I just used 'Karabiner' (download .dmg from linked page, or brew cask install karabiner) to remap that key. Then simply used my standard .tmux.conf with backtick ...


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 ...


0

tmux’s attach-session command does not exit until the client detaches (or its session goes away); your script is effectively paused, waiting for the tmux a command to finish. You probably want to arrange to attach as the last step in your script (unless you have some command that you want to run right after the client detaches). If you want to view the ...


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 ...


0

The following worked for me. To ~/.bashrc, add the line: PS1='$([ -n "$TMUX" ] && tmux setenv TMUXPWD_$(tmux display -p "#I") $PWD)\u@\H:\w$ ' And to ~/.tmux.conf, add the lines: bind-key c run-shell 'tmux neww "cd $(tmux display -p "\$TMUXPWD_#I"); exec bash"' bind-key % run-shell 'tmux splitw -h "cd $(tmux display -p "\$TMUXPWD_#I"); exec ...


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.


0

And improved version of @Leif answer could be: tmux bind-key '[' run "tmux copy-mode; tmux bind-key -n ']' run \"tmux send-keys Enter; tmux save-buffer - | xclip -i -selection clipboard; tmux unbind-key -n ']'\"; tmux bind-key -n q run \"tmux unbind -n ']'; tmux send-keys q\"; tmux bind-key -n C-c run \"tmux unbind -n ']'; tmux send-keys C-c\"" This way ...


2

It seems that there is a race between the new-window and the delete-buffer commands: that is, the buffer "PIPE" is deleted before it can be piped into vim or whatever program you want to be executed. The following ugly hack that sleeps a second before calling delete-buffer fixes the problem for me: bind P command-prompt -I "vim -" \ "capture-pane -eJ ...


3

Those messages are generated by the fortune program, a database of quotations that hails from the UNIX days. The fact that they are appearing when you start tmux (or open a new window or pane) suggests that they are called for your login shell. You can stop this behaviour by removing fortune: apt-get uninstall fortune, and then looking through your shell ...


1

There are alternative repositories from which you can install later versions of tmux, but they are not official. Installing from source is relatively easy: # install any dependency packages needed for building sudo apt-get install -y exuberant-ctags cmake libevent-dev libncurses5-dev # download link from official http://tmux.github.io/ site wget ...



Top 50 recent answers are included