screen-users
[Top][All Lists]
Advanced

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

Re: Migrating scrollback buffer/history?


From: tilt
Subject: Re: Migrating scrollback buffer/history?
Date: Fri, 10 Jul 2015 01:00:46 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1

Hi,

Konstantin Svist wrote on 10/07/2015 at 00:02 CEST:
On 07/09/2015 02:42 PM, tilt wrote:
Konstantin Svist wrote on 09/07/2015 at 19:14 CEST:
Also, is there a way to migrate command history (guessing this is
probably more related to shell, not screen)

In Bourne Again Shell, a "history migration" in bash from a "shell1"
to a "shell2" process can be implemented by performing these steps
(in strict chronological order):

  shell1$ history -a # append new lines to .bash_history now
  shell2$ history -n # read lines from .bash_history not already read

Very cool!
Any idea about same thing in zsh?

Assuming you have set up the history file in .zshrc for example like

   HISTSIZE=5000
   SAVEHIST=5000
   HISTFILE=$HOME/.zsh_history

you can accomplish a history migration from zsh process "shell1" to
"shell2" by issuing (again, strictly in this sequence, to ensure the
histfile is completely written before the other process re-reads it):

    shell1% fc -A
    shell2% fc -R

You might also want to read about INC_APPEND_HISTORY, SHARE_HISTORY
in the zshoptions(1) manpage.

Regards,
Tilman



reply via email to

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