screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exiting screen should exit its windows nicely


From: Alan Young
Subject: Re: exiting screen should exit its windows nicely
Date: Sat, 14 May 2011 08:47:07 -0600

On Fri, May 13, 2011 at 09:53, Sam Steingold <address@hidden> wrote:
> When screen terminates on a signal, does it send EOF to each bash window?
> if it will not, I will lose my bash history!

I don't know how much of this you already have setup, so please ignore
those parts.  I do something similar to what you describe.  I
basically live in screen for everything except browsing the web and
reading feeds (email, newsgroups, etc) and I'm working on moving the
feeds to the CLI as well.

In my .bashrc I set the following:

export HISTCONTROL='ignorespace:erasedups'
                                 export HISTFILESIZE=1000
export HISTSIZE=1000

ignoreboth says to ignore commands beginning with a space
erasedups says to remove any matching commands from the history before
saving this one, effectively keeping the most common commands near the
end of the history.

Also, I have the following shopts:

shopt -s cmdhist
shopt -s histappend
shopt -s histreedit
shopt -s histverify

cmdhist saves multiple line commands as the same history line
histappend tells bash to append to the history file instead of overwriting it
histreedit allows you to edit a failed command
histverify allows you to edit a history line before executing it

And finally, I have this included in my prompt:

PS1="\$(history -a)"

This appends the previous command to the history file everytime the
prompt is displayed.  You will still lose the command if the session
is lost before the prompt is displayed, but this minimizes it as far
as I've been able to get it for myself.

You should read the bash man page.  There are other history related
stuff that I don't use.

Hope this helps.
-- 
Alan Young



reply via email to

[Prev in Thread] Current Thread [Next in Thread]