Open benlaken opened 8 years ago
What version of bash are you using?
The log pane only seems to function with bash 4.2.0 and later (also does not work with bash 3.2.57). In earlier versions, the history is held up until you quit from tmux
, and then all the history is written to the file. You can verify this by running tail -f /tmp/log-file
(or where ever you are saving your log, if you're setting the LOG_FILE
environmental variable) and then seeing the history is only written as soon as you exit tmux
. I ran into this issue with RHEL 6.7 on our cluster and ended up just using the bash 4.3 module from spack:
spack install bash
spack load bash
bash --version
path/to/swc-shell-split-window.sh
Maybe README.md can be updated to mention >= bash-4.2 as a dependency in addition to tmux.
FYI I ran in to this issue, but was able to install a newer bash with macports (or homebrew) and now things seem to be working.
Encountered this right now and fixed with installing new bash with homebrew - thanks for reporting this and for the tips how to fix!
One point: on my MacBook Pro I had a job getting it to work at first, as my default shell was zsh
, and I had to get it to change to the version of bash
installed by homebrew. I also had an issue with the fact that I had put a comment in between two lines of the same command in the shell script, and the script didn't like it.
i.e. do this:
command \
argument \
`# comment` \
other_argument \
`# other comment`
but not this:
command \
argument \
# comment \
other_argument \
# other comment
That is, any comments you put in the middle of a multi-line shell script command should have a backtick at the start and finish of the line (the backtick is the syntax for command substitution - kudos to @giordano for telling me this!)
I'm also having the issue that the history is not shown in the top panel, on my mac.
stdbuf: command not found
set-option -g default-shell /opt/homebrew/bin/bash
) in case this was necessary, but it doesn't seem to make a difference/tmp/swc-split-log-file
, I can see it in the file, but it doesn't appear in the upper panel.@liz-is I used it in teaching in May on my mac, but in default shell (zsh). Does it work on your machine this way?
Seems that on mac the script doesn't write to the /tmp/log-file. Problem may be on line 48
"HISTFILE='${LOG_FILE}' HISTCONTROL=ignorespace PROMPT_COMMAND='history -a' bash --norc; kill '${LOG_PID}'"
with the-a
flag, which is different for mac. When I remove the flag the history is writing to the file. However the history then appears in theSHELL_PANE
not theLOG_PANE
.