Hi,

I am using tmux 1.9a on xterm with tcsh shell.

I wanted to split the panes either vertically or horizontally depending on
the current pane size. So I wrote a shell script for that and am calling
that through a tmux key-binding.

----------
bind / command-prompt -p "man" "run-shell \"$SCRIPTS_PATH/dynamic_split.csh
'man %1'\""
----------

The script runs fine, but I get these tcsh messages in the pane where I
enter that key-binding:

----------
tcsh: No such file or directory
tcsh: Trying to start from "/home/USER"
----------

The inconvenience is that that above warnings mask the pane from where I
launched the "/" key-binding and I have to hit escape to clear it every
time.

Do I need to set some other tmux env var to avoid this from happening? I
already set the SHELL, SHELLTYPE and XTERM_SHELL vars in tmux using set-env
but that didn't help.

Every time I want to access man, I do: PREFIX "/", (key-binding to go to
previous pane), Esc (to clear the tcsh warnings), (key-binding to go to
previous pane), back in the pane with man output.

I tested my script by running $SCRIPTS_PATH/dynamic_split.csh 'man tmux'
directly in tmux and that runs fine; only when tmux run-shell calls it,
tcsh puts out that warning.

For reference, here's the dynamic_split.csh

----------
#!/bin/tcsh
# This script splits the pane depending on the current panes height and
width
# The result is to not result in too narrow or too wide panes after split
set pane_height=`tmux display -p -F '#{pane_height}'`
set pane_width=`tmux display -p -F '#{pane_width}'`
# monitor resolution = 1600 x 1200
# width in chars = 174, height in chars = 59
# Normalize the pane height and width (resolution/char)
set height_factor = `expr 1200 / 59`
set width_factor = `expr 1600 / 174`
set pane_height_norm = `expr $pane_height \* $height_factor`
set pane_width_norm = `expr $pane_width \* $width_factor`
if ( $pane_width_norm > $pane_height_norm ) then
   tmux split-window -h "$*"
else
   tmux split-window -v "$*"
endif
----------

Kaushal Modi
Sent from my Nexus 4
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to