tmux not respecting disabled control flow
Hi, I already asked this question on stackexchange¹, but I got no response. Here's my problem: In my shell I have flow control disabled using stty -ixon. This works perfectly in the shell and when I launch tmux and start programs within tmux. However, when starting a new session from the command line and directly launching a command, the flow control setting is not respected and ctrl-s freezes the terminal. This works: tmux new-session -s foo vim This does not respect the stty flow control setting: tmux new-session -s foo vim How can I disable flow control even in the latter case? Regards Marco ¹ http://unix.stackexchange.com/q/75711/12779 -- AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux not respecting disabled control flow
On 2013–05–14 Nicholas Marriott wrote: > Sounds like it doesn't work for noninteractive shells, probably need to > put the stty somewhere that your shell always reads even if > noninteractive. And where would that be, for instance? > Surely vim should be turning off flow control itself though? As Frank already pointed out, it happens with all applications. Vim was just an example. It works fine without tmux, that's why I assumed it's a tmux issue. It's not practical to file a bug against all applications. Is there something that can be done from within tmux? Marco -- AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux not respecting disabled control flow
On 2013–05–14 Frank Terbeck wrote: > > On 2013–05–14 Nicholas Marriott wrote: > >> Surely vim should be turning off flow control itself though? > > > > As Frank already pointed out, it happens with all applications. > > To be fair, there are applications that do the right thing. The terminal > version of emacs for example. I just tried the most important terminal application I regularly use and they all behave the same, even system tools like htop, iftop, etc. > You could create a wrapper script like this: > > [snip] That's a workaround I will use until I find a solution. Thanks for that. Why is this happening in the first place? If the stty setting is active in the current shell why is it deactivated in it's child? What would be the best place to fix this, tmux or the shell? I know you think the programs are at fault, but apparently it's common practice to make applications respect the stty setting, regardless if it makes sense or not. It's just not practical to file a bug report against so many applications. Marco -- AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux not respecting disabled control flow
On 2013–05–14 Marco wrote: > What would be the best place to fix this, tmux or the shell? Sorry, stupid question. It would have to be fixed in *all* shells, since it's not just one, which would probably be the same hassle as fixing all programs. > I know you think the programs are at fault, but apparently it's > common practice to make applications respect the stty setting, > regardless if it makes sense or not. It's just not practical to > file a bug report against so many applications. Is there anything that can be done from within tmux? Marco -- AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux not respecting disabled control flow
On 2013–05–14 Frank Terbeck wrote: > You could create a wrapper script like this: > > [snip] > #!/bin/sh > > stty -ixon > exec "$@" > [snap] I found another workaround which does not require changing the scripts that launch tmux. Commands in the file ~/.zshenv seems to work regardless of the type of shell (login, interactive, etc.). # ~/.zshenv stty -ixon Obviously this is a ZSH feature. I don't know if a universal solution exists which works also in POSIX shell. Marco -- AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux not respecting disabled control flow
On 2013–05–14 Nicholas Marriott wrote: > We have typically chosen - with a few exceptions - to try and make tmux > create all windows with the same environment no matter how they are > started. This means things are mostly consistent. I don't have much knowledge about terminals internals, so bear with me if this is a foolish idea. What about using the environment that tmux was started in, instead of a clean one? > The problem for you is that tmux is starting all your shells with the > same termios and you are promptly changing it in some shell startup > file. But when you run a command directly your shell, which I guess is > probably bash, decides it is noninteractive and doesn't run your startup > files. That explains it. BTW: I use different shells on different systems, mostly bash and zsh. > You will have the same problem if you do, for example, xterm -e "vim". Indeed. However, I never noticed that. > The easiest solution is to run "stty -ixon; vim" I'd call it “workaround”. I would have to prepend almost every program call in all scripts with “stty”, that's not really elegant and it's duplicated code. > or you could look at BASH_ENV which is apparently also evaluated > for noninteractive shells. You'll need to make sure BASH_ENV ends > up in the tmux global environment (either it's in your environment > at server start or you set it explicitly with tmux setenv -g). This works, for ZSH ~/.zshenv can be used, see my other post. Thanks for your comprehensive answer. Marco -- AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux not respecting disabled control flow
On 2013–05–14 Nicholas Marriott wrote: > The easiest solution is to run "stty -ixon; vim" This is what I'm doing now. My suggestion of setting stty in .zshenv broke too many other programs. Calling the programs like “stty -ixon; vim” has the disadvantage that the automatic window renaming displays “stty” as window name for all programs. Which means I not only have to prepend “stty -ixon;” but also set the window title according to the program, a feature which I really liked about tmux. Marco -- Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Set up session and rename window
Hi, I use shell functions to set up tmux sessions or attach to already existing ones. What I basically do is the following: tmux new-session -s foo -d tmux send-keys -t foo vim C-m tmux new-window -t foo -n monitor htop tmux attach -t foo I use send-keys instead of new-window because I don't want the window to be closed after I quit vim, instead it want to be dropped into a shell. I don't know if the send-keys approach is the right thing to do, but it seems to work. Is there a better way to set up this session? How do I set up the window name for the vim window? Marco signature.asc Description: Digital signature -- Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux not respecting disabled control flow
On 2013–05–24 Chris Johnsen wrote: > That renaming behavior (based on the actual command string, not the process > that is running) sounds like what oh-my-zsh does. You could probably modify > omz_termsupport_preexec in lib/termsupport.zsh to ignore your "stty prefix" > (similar to the way it strips off sudo/ssh/rake and their options from the > start of the command string before using the rest as the basis of the new > name). I don't use oh-my-zsh, however I copied this function and added "stty" to the list of ignored strings and it works. Thanks for the tip Marco -- Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Set up session and rename window
On 2013–06–04 Adrian Luff wrote: > To name the session you can do the following… > > tmux new-session -s foo -d > > tmux new-window -t foo -n "Editor" > > tmux send-keys -t foo vim C-m > > tmux new-window -t foo -n "Top" monitor htop > > Of course this leaves a default shell as the first window. This is not really a solution, more a workaround. Sure, it renames the window, but it leaves a spurious shell behind. I wonder if there's a proper way to rename a window. Thanks for the answer anyway. Marco signature.asc Description: Digital signature -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Copy to system clipboard
Hi, there are plenty of tutorials that suggest a mapping like bind C-y run "tmux show-buffer | xclip -selection clipboard -i" to be able to copy to the system clipboard. This, however, involves an unnecessary copy step. Is there a possibility to directly copy to the clipboard after enter has been pressed? Example: ∙ go selection mode with prefix[ ∙ start selection with space ∙ select the text and press enter After the last step, I'd like the snippet to be in the system clipboard. Is this possible? Marco signature.asc Description: Digital signature -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Mapping meta key within tmux in vim
Hi, I raised this issue already on the vim mailing list¹ without finding a solution. There are probably plenty of vim users on this list. Maybe someone knows how to tackle this. I have mappings in my .vimrc that map the Meta-arrow keys noremap + noremap - This works fine in console vim, but it fails when vim is used within tmux. Then I get sequences like: [1;3Aá] [1;3Bá] When I call cat -v from the console (TERM=rxvt-unicode-256color) and press M- M- I get the following: ^[^[[A ^[^[[A ^[^[[B ^[^[[B When I call cat -v from the console within tmux (TERM=screen-256color) and press M- M- I get the following: ^[[1;3A ^[[1;3A ^[[1;3B ^[[1;3B Which means the terminal interprets the key sequences differently. I have other mappings which work without problems, like: noremap [27;5;9~ :bnext! noremap [27;6;9~ :bprevious! How can I map M- to something useful when I run vim in tmux? Marco ¹ http://thread.gmane.org/gmane.editors.vim/112681 -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Mapping meta key within tmux in vim
On 2013–07–14 Nicholas Marriott wrote: > Did you turn on xterm-keys? Yes, I did. Otherwise my ctrl-tab mappings won't work. Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Mapping meta key within tmux in vim
On 2013–07–14 Nicholas Marriott wrote: > Turn it off if you don't want xterm style arrow keys. As I said, if I turn it off, my ctrl-tab mappings don't work any more. How can I map ctrl-tab without xterm style keys? At the moment I use xterm style and have the following mappings. noremap [27;5;9~ :bnext! noremap [27;6;9~ :bprevious! Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Mapping meta key within tmux in vim
On 2013–07–14 Saad Malik wrote: > It's a long shot, but try removing the 'XT' from terminal-overrides. Add > this to your .tmux.conf: > > set -g terminal-overrides > "xterm*:smcup@:rmcup@:Ms=\\E]52;%p1%s;%p2%s\\007:Ss=\\E[%p1%d > q:Se=\\E[0 q" This didn't work. I still can't map alt-. I joined the three lines, I assume it was supposed to be all in one line. Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Mapping meta key within tmux in vim
On 2013–07–14 Nicholas Marriott wrote: > Either do without C-Tab C-Tab is more important than Meta-, so I'll leave the xterm style on. > or bind the arrow keys differently in vim or whatever you are > using. I have no clue how to do that. That's why I'm asking here and on the vim list. Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Mapping meta key within tmux in vim
Hi, I got it working now. The solution is to use set -g xterm-keys on and mappings like these [1;3A, [1;3B, … Thanks to everyone! Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Share .tmux.conf between different versions
On 2013–07–20 Thomas Adam wrote: > > I tried it and it works. It feels a little fiddly, though; to create > > a set of shell commands which check for the tmux version. Maybe you > > had something more elegant in mind. > > No. That's how to do it. Okay. > > Another question in this context: How to determine the tmux version > > reliably? I just figured that some versions support the -V flag, but > > not all versions do. > > If you're trying to support versions of tmux without -V, then you're > doing it wrong since that version of tmux is old. Debian stable (just released) ships with 1.6, which means even up-to-date servers don't necessarily ship with a current tmux version. Let alone the not so up-to-date servers. > Likewise, anything before tmux 1.8 is quite old also, and I would > consider upgrading. I do not administrate most of the machines. The workstations have fairly new versions >=1.7 but on the servers I am really happy if tmux is installed at all. > Seriously. It's not practical to maintain current versions of the required software tools in the home directory. I did that for many years, but when the number of remote machines grew I gave up on keeping the software up-to-date when I don't have admin rights. Instead I tried to make the config files as portable as possible. Thanks for your quick response and the if-shell trick. Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Share .tmux.conf between different versions
Hi, I'd like to use a single tmux config file across different computers. However, different versions of tmux are running on individual computers, which I can't influence. This leads to errors in the older tmux versions when options are not supported or named differently, e.g. /home/me/.tmux.conf: 14: unknown option: renumber-windows Is there a possibility to allow newer features for more recent tmux versions and hide them from the older ones? In vim this can be realised as follows. if v:version >= 703 if has("patch769") set somenewfeature endif endif Maybe tmux has a similar mechanism. Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Ring terminal bell on alert
Hi, I've just subscribed to the list and while digging through the list's archives, I've seen that this topic is currently being discussed. I just happen to have implemented a similar feature myself a couple of days ago. It would be great to have (something like) that in tmux. This patch (only tested on FreeBSD 8.2-STABLE so far) introduces a new config option "bell-on-alert" that rings the terminal bell for all alert types supported by tmux. If changes to the patch are needed, please let me know. E.g. I could add further options for individual alert types ("bell-on-content-alert", "bell-on-activity-alert" etc.), though that probably is config bloat. Regards, Marco # HG changeset patch # User Marco Beck # Date 1308390888 -7200 # Node ID 64d47bef68e29ce1672c1a75a815655f7b0fa56b # Parent dae3664b7a22ac5bfcc967a44d369e58cf163c9c New feature: ring terminal bell upon (bell, content...) alert diff --git a/cmd-set-option.c b/cmd-set-option.c --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -83,6 +83,7 @@ const struct set_option_entry set_session_option_table[] = { { "base-index", SET_OPTION_NUMBER, 0, INT_MAX, NULL }, { "bell-action", SET_OPTION_CHOICE, 0, 0, set_option_bell_action_list }, + { "bell-on-alert", SET_OPTION_FLAG, 0, 0, NULL }, { "buffer-limit", SET_OPTION_NUMBER, 1, INT_MAX, NULL }, { "default-command", SET_OPTION_STRING, 0, 0, NULL }, { "default-path", SET_OPTION_STRING, 0, 0, NULL }, diff --git a/server-window.c b/server-window.c --- a/server-window.c +++ b/server-window.c @@ -29,6 +29,7 @@ int server_window_check_silence(struct session *, struct winlink *); int server_window_check_content( struct session *, struct winlink *, struct window_pane *); +void ring_bell(struct session *); /* Window functions that need to happen every loop. */ void @@ -135,6 +136,8 @@ if (!options_get_number(&w->options, "monitor-activity")) return (0); + if (options_get_number(&s->options, "bell-on-alert")) + ring_bell(s); wl->flags |= WINLINK_ACTIVITY; if (options_get_number(&s->options, "visual-activity")) { @@ -184,6 +187,8 @@ timer_difference = timer.tv_sec - w->silence_timer.tv_sec; if (timer_difference <= silence_interval) return (0); + if (options_get_number(&s->options, "bell-on-alert")) + ring_bell(s); wl->flags |= WINLINK_SILENCE; if (options_get_number(&s->options, "visual-silence")) { @@ -222,6 +227,8 @@ return (0); xfree(found); + if (options_get_number(&s->options, "bell-on-alert")) + ring_bell(s); wl->flags |= WINLINK_CONTENT; if (options_get_number(&s->options, "visual-content")) { @@ -236,3 +243,18 @@ return (1); } + +/* Ring terminal bell */ +void +ring_bell(struct session *s) +{ + struct client *c; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c == NULL || c->session != s) + continue; + tty_putcode(&c->tty, TTYC_BEL); + } +} diff --git a/tmux.c b/tmux.c --- a/tmux.c +++ b/tmux.c @@ -331,6 +331,7 @@ so = &global_s_options; options_set_number(so, "base-index", 0); options_set_number(so, "bell-action", BELL_ANY); + options_set_number(so, "bell-on-alert", 0); options_set_number(so, "buffer-limit", 9); options_set_string(so, "default-command", "%s", ""); options_set_string(so, "default-path", "%s", ""); -- 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
Re: Ring terminal bell on alert
Hi, On Thu, Jun 23, 2011 at 10:56:28AM +0100, Nicholas Marriott wrote: > This looks okay but the options code has changed for tmux SVN. Can you > provide a diff against the top of SVN? > > Also please add the option to the man page. Sure, the patch attached is against SVN trunk. Thanks, Marco # HG changeset patch # User Marco Beck # Date 1308868029 -7200 # Node ID 75239794e945b99734c3668b654c61ccc2476fd3 # Parent db675b1c6a76574e0555c917c69fa799882d6e0e Ring terminal bell on activity, content and silence alerts diff --git a/options-table.c b/options-table.c --- a/options-table.c +++ b/options-table.c @@ -97,6 +97,11 @@ .default_num = BELL_ANY }, + { .name = "bell-on-alert", + .type = OPTIONS_TABLE_FLAG, + .default_num = 0 + }, + { .name = "default-command", .type = OPTIONS_TABLE_STRING, .default_str = "" diff --git a/server-window.c b/server-window.c --- a/server-window.c +++ b/server-window.c @@ -28,6 +28,7 @@ int server_window_check_silence(struct session *, struct winlink *); int server_window_check_content( struct session *, struct winlink *, struct window_pane *); +void ring_bell(struct session *); /* Window functions that need to happen every loop. */ void @@ -134,6 +135,8 @@ if (!options_get_number(&w->options, "monitor-activity")) return (0); + if (options_get_number(&s->options, "bell-on-alert")) + ring_bell(s); wl->flags |= WINLINK_ACTIVITY; if (options_get_number(&s->options, "visual-activity")) { @@ -183,6 +186,9 @@ timer_difference = timer.tv_sec - w->silence_timer.tv_sec; if (timer_difference <= silence_interval) return (0); + + if (options_get_number(&s->options, "bell-on-alert")) + ring_bell(s); wl->flags |= WINLINK_SILENCE; if (options_get_number(&s->options, "visual-silence")) { @@ -221,6 +227,8 @@ return (0); xfree(found); + if (options_get_number(&s->options, "bell-on-alert")) + ring_bell(s); wl->flags |= WINLINK_CONTENT; if (options_get_number(&s->options, "visual-content")) { @@ -235,3 +243,18 @@ return (1); } + +/* Ring terminal bell */ +void +ring_bell(struct session *s) +{ + struct client *c; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c == NULL || c->session != s) + continue; + tty_putcode(&c->tty, TTYC_BEL); + } +} diff --git a/tmux.1 b/tmux.1 --- a/tmux.1 +++ b/tmux.1 @@ -1766,6 +1766,11 @@ means all bells are ignored and .Ic current means only bell in windows other than the current window are ignored. +.It Xo Ic bell-on-alert +.Op Ic on | off +.Xc +If on, ring the terminal bell when an activity, content or silence alert +occurs. .It Ic default-command Ar shell-command Set the command used for new windows (if not specified when the window is created) to -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
[PATCH] Add command to refresh status bar
Usually my status bars include ouput from external programs (e.g. biff-like information on new mails, summary of Nagios states etc.). Previous to tmux 1.5 a config reload resulted in immediate re-execution of external commands. While the current behaviour probably is more sane, I miss the ability to force a full status bar refresh including triggering aforementioned commands without having to rely on very short status update intervals (e.g. to reset my status bar biff after having read a newly arrived mail). The attached patch introduces a new command 'refresh-status' to allow this. Marco # HG changeset patch # User Marco Beck # Date 1317154638 -7200 # Node ID dcbe3b0731710931a6091104cbbd512540664e57 # Parent 2a041ad30bca5f26d6ca8c056957e0ce364a8305 Add new command to refresh status bar. diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -102,6 +102,7 @@ cmd-paste-buffer.c \ cmd-pipe-pane.c \ cmd-refresh-client.c \ + cmd-refresh-status.c \ cmd-rename-session.c \ cmd-rename-window.c \ cmd-resize-pane.c \ diff --git a/cmd-refresh-status.c b/cmd-refresh-status.c new file mode 100644 --- /dev/null +++ b/cmd-refresh-status.c @@ -0,0 +1,47 @@ +/* $Id$ */ + +/* + * Copyright (c) 2011 Marco Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "tmux.h" + +/* + * Refresh status bar. + */ + +int cmd_refresh_status_exec(struct cmd *, struct cmd_ctx *); + +const struct cmd_entry cmd_refresh_status_entry = { + "refresh-status", "", + "", 0, 0, + "", + 0, + NULL, + NULL, + cmd_refresh_status_exec +}; + +int +cmd_refresh_status_exec(unused struct cmd *self, struct cmd_ctx *ctx) +{ + struct client *c; + + c = cmd_current_client(ctx); + status_update_jobs(c); + c->flags |= CLIENT_STATUS; + + return (0); +} diff --git a/cmd.c b/cmd.c --- a/cmd.c +++ b/cmd.c @@ -76,6 +76,7 @@ &cmd_previous_layout_entry, &cmd_previous_window_entry, &cmd_refresh_client_entry, + &cmd_refresh_status_entry, &cmd_rename_session_entry, &cmd_rename_window_entry, &cmd_resize_pane_entry, diff --git a/tmux.1 b/tmux.1 --- a/tmux.1 +++ b/tmux.1 @@ -696,6 +696,8 @@ Refresh the current client if bound to a key, or a single client if one is given with .Fl t . +.It Ic refresh-status +Refresh the status bar. .It Xo Ic rename-session .Op Fl t Ar target-session .Ar new-name diff --git a/tmux.h b/tmux.h --- a/tmux.h +++ b/tmux.h @@ -1600,6 +1600,7 @@ extern const struct cmd_entry cmd_previous_layout_entry; extern const struct cmd_entry cmd_previous_window_entry; extern const struct cmd_entry cmd_refresh_client_entry; +extern const struct cmd_entry cmd_refresh_status_entry; extern const struct cmd_entry cmd_rename_session_entry; extern const struct cmd_entry cmd_rename_window_entry; extern const struct cmd_entry cmd_resize_pane_entry; -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCH] Add command to refresh status bar
Hi Nicholas, On Tue, Sep 27, 2011 at 10:50:39PM +0100, Nicholas Marriott wrote: > > Can you make this a flag (-S or -s or whatever) to refresh-client > instead of a new command? Of course, this is much better. Updated patch (against SVN trunk) is attached. Thanks, Marco # HG changeset patch # User Marco Beck # Date 1317224819 -7200 # Node ID d26aac2352312550f863454f1ab3c7814dd0ffa7 # Parent 2a041ad30bca5f26d6ca8c056957e0ce364a8305 Add option '-S' to refresh-client to additionally update the status bar. diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c --- a/cmd-refresh-client.c +++ b/cmd-refresh-client.c @@ -28,8 +28,8 @@ const struct cmd_entry cmd_refresh_client_entry = { "refresh-client", "refresh", - "t:", 0, 0, - CMD_TARGET_CLIENT_USAGE, + "St:", 0, 0, + "[-S] " CMD_TARGET_CLIENT_USAGE, 0, NULL, NULL, @@ -45,6 +45,11 @@ if ((c = cmd_find_client(ctx, args_get(args, 't'))) == NULL) return (-1); + if (args_has(args, 'S')) { + status_update_jobs(c); + c->flags |= CLIENT_STATUS; + } + server_redraw_client(c); return (0); diff --git a/tmux.1 b/tmux.1 --- a/tmux.1 +++ b/tmux.1 @@ -691,11 +691,17 @@ are invalid if .Fl t is used. -.It Ic refresh-client Op Fl t Ar target-client +.It Xo Ic refresh-client +.Op Fl S +.Op Fl t Ar target-client +.Xc .D1 (alias: Ic refresh ) Refresh the current client if bound to a key, or a single client if one is given with .Fl t . +If +.Fl S +is specified, also update the status bar. .It Xo Ic rename-session .Op Fl t Ar target-session .Ar new-name -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: [PATCH] Add command to refresh status bar
On Wed, Sep 28, 2011 at 07:42:03PM +0100, Nicholas Marriott wrote: > This looks good, but I think CLIENT_REDRAW (set by > server_redraw_client()) will already redraw the status line so no need > to set CLIENT_STATUS as well. Yeah, this seems superfluous. > Although, are you sure -S should redraw the entire client or should it > not just redraw just the status line? You're right, the former is probably overkill (and even more so for my use case). I changed it in the patch attached. Thanks, Marco # HG changeset patch # User Marco Beck # Date 1317236639 -7200 # Node ID 5b89a79d5b1a7ce4515e97f11068d54aaa74d903 # Parent 2a041ad30bca5f26d6ca8c056957e0ce364a8305 Add option '-S' to refresh-client to update a client's status bar. diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c --- a/cmd-refresh-client.c +++ b/cmd-refresh-client.c @@ -28,8 +28,8 @@ const struct cmd_entry cmd_refresh_client_entry = { "refresh-client", "refresh", - "t:", 0, 0, - CMD_TARGET_CLIENT_USAGE, + "St:", 0, 0, + "[-S] " CMD_TARGET_CLIENT_USAGE, 0, NULL, NULL, @@ -45,7 +45,11 @@ if ((c = cmd_find_client(ctx, args_get(args, 't'))) == NULL) return (-1); - server_redraw_client(c); + if (args_has(args, 'S')) { + status_update_jobs(c); + server_status_client(c); + } else + server_redraw_client(c); return (0); } diff --git a/tmux.1 b/tmux.1 --- a/tmux.1 +++ b/tmux.1 @@ -691,11 +691,17 @@ are invalid if .Fl t is used. -.It Ic refresh-client Op Fl t Ar target-client +.It Xo Ic refresh-client +.Op Fl S +.Op Fl t Ar target-client +.Xc .D1 (alias: Ic refresh ) Refresh the current client if bound to a key, or a single client if one is given with .Fl t . +If +.Fl S +is specified, only update the client's status bar. .It Xo Ic rename-session .Op Fl t Ar target-session .Ar new-name -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: Share .tmux.conf between different versions
On 2013–07–19 Thomas Adam wrote: > > I'd like to use a single tmux config file across different > > computers. However, different versions of tmux are running on > > individual computers, which I can't influence. This leads to errors > > in the older tmux versions when options are not supported or named > > differently, e.g. > > You could use if-shell to source specific files on different machines. You mean to create a set of commands like tmux_min_1.6 tmux_min_1.7 tmux_min_1.8 etc. and use something like this: if-shell tmux_min_1.7 'set-option -g renumber-windows on' I tried it and it works. It feels a little fiddly, though; to create a set of shell commands which check for the tmux version. Maybe you had something more elegant in mind. Another question in this context: How to determine the tmux version reliably? I just figured that some versions support the -V flag, but not all versions do. Marco -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users