Open informafix opened 5 years ago
I have the exact same problem, all my panes are filled with fc -lLn -64 > '/Users/leseb/.tmux/resurrect/zsh_history-leseb:7.0
. I didn't have this until recently and it's quite annoying :(
Yes, I found that annoying too. Even if it's not possible to do not print these command to the panes, it is possible to clear the pane output after command execution. For example I have following binding to clear window pane:
bind C-l send-keys -R \; send-keys C-l \; clear-history
BTW, great plugin, thanks a lot!
everything is amazing with my resurrect life! (macOS 10.12.6, Iterm2 3.2.5, tmux 2.8, latest ressurect and continuum)
Apart from this. I updated my tmux plugins after 'some time' today to find that these things happen at the continuum interval:
fc -R
commands appear in each terminal^E fc -R '/Users/twoode/.tmux/resurrect/zsh_history-0:1.2'
, so quickly take up the whole panefc
command runs, it will send the entire error message produced by the result to my history making tens of lines of bad history entries!fc
command sometimes totally replaces my vim session, requiring multiple presses of the return key to clear and get back to all the vim windows(jump forward)
, and text like:
'cd [some path on my pc]; open [some file on my pc] > /dev/null' returned 1
'cd [some path on my pc]; open "s" > /dev/null' returned 1
it overwrites the entire tmux window, again requiring interaction to clear
I see this is a very similar issue to https://github.com/tmux-plugins/tmux-resurrect/issues/86, but with zsh. I also see this: https://github.com/AdrieanKhisbe/zsh-quiet-accept-line - Adriene says that he made this plugin to help ease this issue, but he doesn't say how he modded, I don't see a fork he's made, nor interaction with the issues here...
Having these issues with interval at 15 minutes is not doable. I didn't even notice zsh wasn't saving my history previously. Is there any better solution than set -g @resurrect-save-shell-history 'off'
?
Hi guys,
I'm sorry that saving shell history isn't working flawlessly for you. As you know, this feature is marked "experimental" so yea, not perfect.
I thought hard if this downside could be avoided (for bash) and found no solution. I personally gave up on using this feature and was considering removing it altogether because it cannot be made right. At this point, I'm at most accepting improvements for it.
I'd also be ok with honestly writing downsides upfront in this doc so that new users don't get too excited about it https://github.com/tmux-plugins/tmux-resurrect/blob/master/docs/restoring_shell_history.md
@bruno-, if this feature is on its way to being abandoned, do you have any ideas on how to approach this problem with a different strategy all together?
For example, there's this fork of your project (https://github.com/markeissler/tmux-resurrect-ng#why) that says it integrates with your bash prompt directly and runs some commands in the background. I'd rather stick to your plugin because it's well maintained and works with newer versions of tmux.
Any thoughts on using that type of strategy (or similar) in your plugin? Thanks for the great plugin btw!
Hey,
I'm open to accepting a PR with another working strategy that's not too hacky.
I'm new to the tmux ecosystem beyond just using it, so I wouldn't really know where to begin with that when it comes to plugin development. Do you have any general ideas on how it could be implemented in a non-hacky way?
Currently I'm running Windows 10 with WSL and tmux works great there, but Windows is Windows, which means quite a few of unplanned reboots (forced patches that are automated by Microsoft), so losing my sessions is a real problem. Your plugin is a fantastic fix for that, but history is important too.
Hi @bruno- . It seems once I set set -g @resurrect-save-shell-history 'on'
on .tmux.conf, I have to set set -g @resurrect-save-shell-history 'off'
to unset the saving history function which means comment set -g @resurrect-save-shell-history 'on'
on .tmux.conf doesn't work.
And after restore, I always got a %
on the shell, though it's not an so annoying problem, I want to know it's my setting error or I got same with everyone.
I'm not a long time tmux-resurrection user but really like it. History is kind of crucial for me, without history I suppose using a tiling wm with pre-configured terminals opening at start might an alternative. At least history would be available from the shell. Actually I intended to ask whether there is a chance to get history working with ksh but I suppose I know the answer. Anyhow, this is a very useful tool, thank you for your work.
@macandchief history feature is very buggy, and honestly not recommended as it just does not work. I'd like to remove it from this plugin.
I've found another way to keep history of commands I make inside my tmux panes:
https://askubuntu.com/a/339925
You have to preserve bash history in multiple bash shells. To do this, be sure that you have the following lines in your ~/.bashrc file:
# avoid duplicates.. export HISTCONTROL=ignoredups:erasedups # append history entries.. shopt -s histappend # After each command, save and reload history export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
it's not perfect as all panes share the same history, but it's much better than nothing
hope this helps someone
Maybe sending signals to trigger a bash helper function could make this work without invoking history
commands from the terminal?
http://blog.nqzero.com/2016/02/save-bash-history-remotely-by-sending.html
Hello
This is not an issue but a behavior i'd like to change.
When saving history, tmux-resurrect shows its command in each tmux panes
I've found in SAVE.SH line 158
local history_w='fc -lLn -64 >'
also line 159local history_r='fc -R'
and in RESTORE.SH line 285local read_command="fc -R '$history_file'; clear"
So I ask myself if there's a way to hide those commands showing very frequently in tmux panes, like adding
> /dev/null
at the end of those commands ? or using theSILENT
flag thanks