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

One line config in tmux.conf to turn "save-complete-history" always on? #7

Open
xinbenlv opened this issue Apr 3, 2015 · 8 comments

Comments

@xinbenlv
Copy link

xinbenlv commented Apr 3, 2015

No description provided.

@xinbenlv
Copy link
Author

xinbenlv commented Apr 3, 2015

Hi Author, really appreciate this tool. very helpful. I would like to propose a feature request
One line config in tmux.conf to turn "save-complete-history" always on.

Also, better to be able to set the output-path in the conf

Is it something that you will be considering?

@xinbenlv xinbenlv changed the title One line config in tmux.conf to turn " One line config in tmux.conf to turn "save-complete-history" always on? Apr 3, 2015
@bruno-
Copy link
Member

bruno- commented Apr 3, 2015

Hey,
changing the logging output path and filename is already possible (just not documented).
Take a look here.

As for the "save-complete-history" always on feature, I'll gladly accept a pull request for this.

@k3rne
Copy link

k3rne commented Jun 11, 2018

@xinbenlv hi, did you find a way to turn "save-complete-history" always on?

I want to save my history always, for every pane that I create.

@CNG
Copy link

CNG commented Jul 5, 2018

Came here looking for this feature as well, but for now I will try this workaround that seems to work. The idea is I usually exit shell by Ctrl+D, so I hijack that sequence to run the save history command and then tell Tmux to kill the pane, which results in my terminal closing as usual right after (I'm on Arch Linux using Alacritty and Zsh.):

bind-key -n C-d if-shell "$HOME/.tmux/plugins/tmux-logging/scripts/save_complete_history.sh" "send-keys exit Enter"

@ghost
Copy link

ghost commented Aug 27, 2018

@CNG : Good idea, however, how can we have immediately enter? I feel a little delay when we have to wait somehow for the command to just display at bottom of screen.

@CNG
Copy link

CNG commented Jan 26, 2019

@tuyenpm9 : I didn't see a way to adjust the message display time with the provided configuration, but you should apparently be able to either adjust the 5000 default at

local display_duration="5000"
or add a value in save_complete_history.sh such as:

display_message "History saved to ${file}" 750

@bedge
Copy link

bedge commented May 25, 2019

Related to always log: #31

You could use ~/.tmux/plugins/tmux-logging/scripts/toggle_logging.sh in your .bash_profile.

@tchinchow
Copy link

I came around a similar need and solved it before I looked at this page.

I took a different angle and also came to the conclusion that the scripts/toggle_logging.sh script would do the job.

It seems like it was not a good idea to toggle logging on right from the scripts/logging.tmux script/plugin therefore I added the call to a hook that runs whenever a new session is created.

tmux set-hook -g after-new-session "run-shell $CURRENT_DIR/scripts/toggle_logging.sh"

I also linked this behaviour to a global variable in scripts/variables.sh like its done for logging_path.

I don't quite like the idea of tweaking the .bashrc file (suggested by #31) because its influence spans way beyond that of tmux only: consequences could be tougher than anticipated...
... this is why I dare commenting here and proposing my "solution".

Do you think it could be a valid and elegant way of turning logging on as soon as the session starts ?
Would you welcome a pull request for this ?

tchinchow added a commit to tchinchow/tmux-logging that referenced this issue Jan 7, 2025
…to automatically turn on logging for new panes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants