Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac doesn't show the history on the top panel #2

Open
benlaken opened this issue Jul 13, 2016 · 6 comments
Open

Mac doesn't show the history on the top panel #2

benlaken opened this issue Jul 13, 2016 · 6 comments

Comments

@benlaken
Copy link

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 the SHELL_PANE not the LOG_PANE.

@omsai
Copy link

omsai commented Sep 5, 2016

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.

@djhoese
Copy link

djhoese commented Jul 19, 2018

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.

@olexandr-konovalov
Copy link

Encountered this right now and fixed with installing new bash with homebrew - thanks for reporting this and for the tips how to fix!

@mattagape
Copy link

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!)

@liz-is
Copy link

liz-is commented Jul 19, 2024

I'm also having the issue that the history is not shown in the top panel, on my mac.

  • I installed bash (5.2.26) via homebrew
  • also had to install coreutils as I was getting the error stdbuf: command not found
  • tried setting the homebrew bash as the default shell in ~/.tmux.conf (set-option -g default-shell /opt/homebrew/bin/bash) in case this was necessary, but it doesn't seem to make a difference
  • the history is being written to /tmp/swc-split-log-file, I can see it in the file, but it doesn't appear in the upper panel.

@olexandr-konovalov
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants