Re: Question about monitor mode / ignoreeof / EOF read

2023-01-19 Thread Chet Ramey

On 1/16/23 6:35 PM, Steffen Nurpmeso wrote:


It turns out that the inner shell tries to set the process group
(to the parent shell which no longer exists), then causing the
interactive bash on the terminal to read an EOF next, and without
ignoreeof set the interactive shell then exits.  (This happens
also when "set +m" is called after the wait ie when parent is gone
already.  .. I have never really looked what shells do, and when.)


Thanks for the report. It's a pretty easy (one line) fix for a rather
unusual set of circumstances.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/




Re: Question about monitor mode / ignoreeof / EOF read

2023-01-19 Thread Steffen Nurpmeso
Chet Ramey wrote in
 :
 |On 1/16/23 6:35 PM, Steffen Nurpmeso wrote:
 |> It turns out that the inner shell tries to set the process group
 |> (to the parent shell which no longer exists), then causing the
 |> interactive bash on the terminal to read an EOF next, and without
 |> ignoreeof set the interactive shell then exits.  (This happens
 |> also when "set +m" is called after the wait ie when parent is gone
 |> already.  .. I have never really looked what shells do, and when.)
 |
 |Thanks for the report. It's a pretty easy (one line) fix for a rather
 |unusual set of circumstances.

Oh!  Then i look forward to see the patch.
Ciao,

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



[Suggestion] Flush command history to a "backup" file periodically

2023-01-19 Thread Peter
Currently, in the event bash or something below it crashes, that
session's command history is lost.
It would be nice if bash saved it somewhere periodically, it doesn't
have to be too often, let's say on every second command.
That way, history could be restored from the "backup" file when the
shell starts after a crash, for example.


Let me know what you think. Thank you.



Re: [Suggestion] Flush command history to a "backup" file periodically

2023-01-19 Thread Greg Wooledge
On Fri, Jan 20, 2023 at 12:08:36AM +, Peter wrote:
> Currently, in the event bash or something below it crashes, that
> session's command history is lost.
> It would be nice if bash saved it somewhere periodically, it doesn't
> have to be too often, let's say on every second command.

History management is an extremely serious personal mission for some
people.  For others, not so much.

The good news is, bash gives you plenty of tools to create your own
personalized history management system.  For you, perhaps something
like this might work:

 * In .bashrc, set seconds_since_history_save=0

 * Set up PROMPT_COMMAND to check whether the difference between
   SECONDS and seconds_since_history_save is greater than some threshold
   value.  If it is, write history to a file, and set
   seconds_since_history_save=$SECONDS.

Details left to the reader.