Comments (9)
Hey Mark, thanks for reporting.
I think one of the solutions for this would be to have this in .bashrc
:
# commands that don't show in history
export HISTIGNORE="history:some_other_command"
Other than the above, I'd be happy to accept a pull request for this.
@rburny do you have any idea how to fix this?
from tmux-resurrect.
Have you noticed that our history write command has a leading space? If you have HISTCONTROL
variable set either to ignorespace
or ignoreboth
, this will cause Bash history to ignore it. These settings are default on Ubuntu, not sure about other distros. If you don't have it yet, just add this to your .bashrc
:
export HISTCONTROL=ignoreboth
To learn more, search for HISTCONTROL
in man bash
.
from tmux-resurrect.
So that's what the space is for... I added this to my .bashrc
:
if [[ -n "${TMUX}" ]]; then
# do not record the tmux save bash history command
export HISTCONTROL=ignorespace
fi
That should take care of it the next time I restart tmux's parent terminal session.
@bruno I think adding a note in the README (under Restoring bash history (experimental)) advising non-Ubuntu users to add this to their .bashrc would be the easiest fix.
from tmux-resurrect.
Yeah, we should note in a README that HISTCONTROL=ignoreboth
is helpful.
BTW, you can safely apply this setting unconditionally, it is pretty convenient (ignoreboth
also includes ignoredups
, which prevents saving dupicates to history).
from tmux-resurrect.
Hi guys,
I'm glad you figured out the issue, @rburny thanks for the help.
Before asking for actions on behalf of the users in the readme, is there a way for us to automate this?
@rburny can we prepend the history
command with HISTCONTROL=ignoreboth
so that commands with space are automatically and always ignored?
from tmux-resurrect.
So, would updating this line like this work?
local write_command=" HISTCONTROL=ignoreboth history -w '$(resurrect_history_file "$pane_id")'"
from tmux-resurrect.
Sorry for the number of comments here.. but if the above command won't work, can you please submit a PR for the proposed README update? (please make it terse)
I'm asking this because I just found about the HISTCONTROL
from this thread and I'm afraid if I wrote it I might make some basic mistake in the description.
from tmux-resurrect.
Prepending the option does not work. I couldn't find a way to achieve this, and I'm not even sure whether we should use such hacks. Since the write command is visibile to the user, I would rather keep it simple and understandable at a glance.
I have added a few lines to README, see #55 .
from tmux-resurrect.
Thanks for the investigation on this @rburny
Closing the issue as your pull request #55 fixes this!
from tmux-resurrect.
Related Issues (20)
- resurrect files not saving expected data
- Save env variables as well
- Restoring non-existing directories
- Save problems
- Tests failing on clean checkout from master. HOT 1
- Description in document save_dir.md is not complete
- Problem recreate windows
- How to start tmux server with resurrect
- resurrect creates minimal sized horizontal splits
- Resurrect not saving the tmux session as intended HOT 2
- C-b C-r to restore session will end up with [exited] from tmux client on iSH(iOS alpinelinux)
- Login shell not invoked for zsh
- [Question] Create new sessions/windows/layouts using a file - supported?
- [BUG] saving with nvim opens the incorrect files if you have spaces in filenames
- How to upgrade from 3.0 and keep saved sessions ?
- [Bug] Restoring sessions is adding a new empty prompts everytime
- [BUG] Hooks pre-restore-all and post-restore-all don't work correctly with tmux v3.4 HOT 1
- plugin not saving correct command
- automatically restore HOT 1
- Does not save, does not restore, returned 127
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmux-resurrect.