Y
Y
yuretsz2010-09-02 22:14:37
linux
yuretsz, 2010-09-02 22:14:37

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

4 answer(s)
S
sin_avatar, 2010-09-02
@yuretsz

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"

Y
yuretsz, 2010-09-02
@yuretsz

>> @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.

M
mm_aa, 2010-09-02
@mm_aa

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

Y
yuretsz, 2010-09-02
@yuretsz

>> 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 question

Ask a Question

731 491 924 answers to any question