tmux

tmux tabs with name of file open in vim

狂风中的少年 提交于 2019-11-28 04:09:24
I'm new to tmux and am trying to figure out how to edit the configuration so that windows with vim open show up in the taskbar not as #:vim but as whatever the name of the file open in vim is (ie "#:filename.php") . Seems like it should be a common thing, but my search - foo is failing. chepner Here's a partial answer. It can be improved, but I don't have time to work it out right now. Put the following in your .vimrc : autocmd BufReadPost,FileReadPost,BufNewFile * call system("tmux rename-window " . expand("%")) There are other events (see :help autocmd-events in Vim) that may be used to

How to set up tmux so that it starts up with specified windows opened?

落爺英雄遲暮 提交于 2019-11-28 02:31:00
How to set up tmux so that it starts up with specified windows opened? Amjith You can write a small shell script that launches tmux with the required programs. I have the following in a shell script that I call dev-tmux. A dev environment: #!/bin/sh tmux new-session -d 'vim' tmux split-window -v 'ipython' tmux split-window -h tmux new-window 'mutt' tmux -2 attach-session -d So everytime I want to launch my favorite dev environment I can just do $ dev-tmux Waqar Lim I was trying to create a complex grid of panes and had to deal with switching and splitting panes over and over again. Here are my

How can I clear scrollback buffer in Tmux?

白昼怎懂夜的黑 提交于 2019-11-27 19:42:33
问题 FYI, I am using Tmux through the Mac OS X Terminal app. 回答1: This same question has been plaguing me for quite some time. Here's the best I've come up with. Put this into your .tmux.conf file: bind -n C-k clear-history This binds ctrl-k to the tmux clear-history command. The -n after bind makes it so you don't have to issue the tmux command prefix (ctrl-b by default). I use bash, so ctrl-l already does the equivalent of typing "clear" at the command line. With these two keys I get a nice ctrl

Bind Ctrl+Tab and Ctrl+Shift+Tab in tmux

痞子三分冷 提交于 2019-11-27 18:20:34
I'm trying to a get a ctrl + tab and ctrl + shift + tab binding to work inside of a tmux session (I'm also using PuTTY). I already went through the pains of having to recompile PuTTY so it would send ctrl and shift correctly. After using ctrl + v , and I'm able to see that ^[[27;5;9~ and ^[[27;6;9~ are being sent for ctrl + tab and ctrl + shift + tab , respectively. Is there any way I can get these bound to next-window and previous-window inside of tmux? Edit: After some research, I'm thinking I might have to configure xterm to include those keycodes. Any idea how I would go about doing that?

Is there any way to redraw tmux window when switching smaller monitor to bigger one?

半腔热情 提交于 2019-11-27 16:33:40
Let's say you're connecting to a remote server over ssh with Terminal.app. When you "tmux attach" with bigger resolution monitor from smaller one you previously started tmux, it draws dots around the console. It doesn't fit the new window size. Is there any way to redraw and clean the window? CTRL + L or CTRL - B + R doesn't help. I couldn't find any proper command on man. % tmux -V tmux 1.5 Chris Johnsen tmux limits the dimensions of a window to the smallest of each dimension across all the sessions to which the window is attached. If it did not do this there would be no sensible way to

linux 使用tmux

半城伤御伤魂 提交于 2019-11-27 14:04:56
一. 什么是tmux 1.1. tmux 是两个单词的缩写,即“Terminal MultipleXer”,意思是“终端复用器“ 1.2. tmux 结构 1.2.1. tmux主要由三层: <1>. Session 一组窗口的集合,通常用来概括同一个任务。session可以有自己的名字便于任务之间的切换。 <2>. Window 单个可见窗口。Windows有自己的编号,也可以认为和ITerm2中的Tab类似。 <3>. Pane 窗格,被划分成小块的窗口,类似于Vim中 C-w +v 后的效果。 二. tmux安装 sudo apt-get install tmux 三. tmux 快捷键 3.1. Tmux 为了防止与全局快捷键冲突,大部分快捷键需要先需要输入前缀 Ctrl + b ,下文用 Prefix 代替 3.2. 设置成鼠标模式 <1>. Prefix + :进入命令行 <2>. 输入: set -g mouse on 3.3. session快捷键 # 创建 tmux new # 不指定session name tmux new -s [session-name] # 删除Session tmux kill-session -t [session-name] tmux kill-server # 列出当前Session tmux ls # Prefix s #

How to write a shell script that starts tmux session, and then runs a ruby script

冷暖自知 提交于 2019-11-27 11:29:33
问题 I want to write a shell script that does this: First, create a tmux session Second, run a ruby script called "run.rb" INSIDE the tmux session In pseudo-code, what I want to do: tmux new -s my_session ruby run.rb # NOTE: I want this to run inside the my_session tmux session. tmux detach How do I do this? (More posts I read, more confusing it gets.) 回答1: #!/bin/bash tmux new-session -d -s my_session 'ruby run.rb' Create a file named my_script.sh and give it the above contents. Make the file

.bashrc/.profile is not loaded on new tmux session (or window) — why?

会有一股神秘感。 提交于 2019-11-27 10:12:30
问题 When tmux starts or opens a new window, it does not load my .profile or .bashrc . I end up typing . ~/.bashrc every time. Is there a way to make this happen automatically? 回答1: Yes, at the end of your .bash_profile , put the line: . ~/.bashrc This automatically sources the rc file under those circumstances where it would normally only process the profile. The rules as to when bash runs certain files are complicated, and depend on the type of shell being started (login/non-login, interactive

Ugrade tmux from 1.8 to 1.9 on Ubuntu 14.04

柔情痞子 提交于 2019-11-27 09:31:24
问题 I was just adding tmux plugins to my .tmux.conf file to find out that one of the plugins (tmux-copycat I think) requires tmux 1.9. When I start tmux I get the message `Error: Tmux version unsupported. Please install tmux version 1.9 or greater!". So, what is the best way to upgrade tmux 1.8 to 1.9 on Ubuntu 14.04? 回答1: Update : due to new tmux version and changes in package repository, this answer is updated to show how to install tmux 2.0 (which is better, no reason to use 1.9 anymore). Here

Keep the window's name fixed in tmux

梦想的初衷 提交于 2019-11-27 09:07:25
问题 I'm new to tmux. I want to keep the windows' name fixed after I rename it. But after I renaming it, they keep changing when I execute the commands. Is there any way that I can keep them in a static name? 回答1: As shown in a comment to the main post: set-option -g allow-rename off in your .tmux.conf file 回答2: As suggested on the Super User link, setting the following variable in your .bashrc or .zshrc seems to solve the issue: DISABLE_AUTO_TITLE=true 回答3: # set-window-option -g automatic-rename