Prevent history command from being recorded#133
Prevent history command from being recorded#133Purg wants to merge 2 commits intotmux-plugins:masterfrom
Conversation
If the assumed HISTCONTROL settings are not present, the history command is written to the saved file, causing the history command to reappear when restoring panes. This longer command prevents the saving of the command regardless of the HISTCONTROL settings by writing it out and then copping off the final history line containing the write command. The long command also ends with clearing and restoring the local history with what was recorded in order to prevent the history writing command from leaking into the saved file when performing multiple tmux save actions.
|
Hey, Unfortunately the above problem explanation is so dense I'm unable to figure out what's wrong. Would you mind passing a couple examples? |
|
Sorry for the late response. Basically what's happening for me is that when saving the session the history dump command is being saved with a panes history. This was previously addressed by assuming a specific HISTCONTROL setup. When HISTCONTROL was not setup in the assumed way, the history dump commands were saved in this history dump, causing them to be the most recent command when restoring pane histories. This change constructs a longer command, but should generically fix the issue where the history dump command is saved. With this commit, after a tmux restore, the last command in the history of a pane is the last command actually performed by the user, not the history dump command. |
|
For example, before this change, the last command in the history of all restored panes was the |
|
Before, the command was assuming |
|
I feel the proposed solution is a bit too heavy-handed, as it involves several operations on potentially large history files. Here is a proposal that works regardless of the value for Note that there SHOULDN'T be a space at the start of the line (contrary to how things are now in |
|
Sounds better than what came up with. Commit in a minute. |
|
Bump? |
If the assumed HISTCONTROL settings are not present, the history command is written to the saved file, causing the history command to reappear when restoring panes. This longer command prevents the saving of the command regardless of the HISTCONTROL settings by writing it out and then copping off the final history line containing the write command. The long command also ends with clearing and restoring the local history with what was recorded in order to prevent the history writing command from leaking into the saved file when performing multiple tmux save actions.