Answer the question
In order to leave comments, you need to log in
Screen and history?
In my ubuntu I use Screen terminal multiplexer all the time. He copes with his functions perfectly well, but he has one puncture - this is the history of commands. An incomprehensible damn thing happens to her, but I can’t find my commands there. Can anyone suggest how to make the command history work as it should?
Answer the question
In order to leave comments, you need to log in
It seems that one bash overwrites the history of others: I
suggest:
1. Add, rather than overwrite
shopt -s histappend
2. Keep multi-line commands on one line (optional):
shopt -s cmdhist
3. After each command, reset the history and re-read the total history ( this is if you want commands from one bash to appear in another).
export PROMPT_COMMAND='history -a; history -n'
4. Cosmetic: do not remember command repetitions, do not save specified commands
export HISTCONTROL="ignoredups"
export HISTIGNORE="ls:l:ll:[bf]g:exit"
>> @yuretsz didn't get it. I tried to execute what was described in both konsole and tty, and nothing happened WarGoth, today at 23:51
But do you always use screen? Try, for example, looking there for cat .bash_history | grep aptitude and compare from memory with what you installed.
Your best bet is to switch to zsh and enable:
setopt share_history # share history between multiple instances
then the history will be shared between different windows.
zsh.sourceforge.net/Doc/Release/Options.html#SEC105
>> damnerd: And you finish the “windows” in a good way, i.e. Ctrl+D (either exit or logout)?
As it happens, if there are 1-3 sessions, then exit, and if more then Ctrl + D many times, but sometimes, of course, it happens that it’s just a reboot. It seems that it does not affect the result (do not understand how it is saved).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question