zsh: SHARE_HISTORY or INC_APPEND_HISTORY breaks EXTENDED_HISTORY

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite














I would like to both share history across terminals and keep track of elapsed time for history commands. The intuitive way seems to be to use both EXTENDED_HISTORY and SHARE_HISTORY, but this sets all elapsed timestamps to 0 after restarting the shell. Is this the correct way to do it? Is it even possible?



Scenario 1: EXTENDED_HISTORY and SHARE_HISTORY



$ history -Dn | sed 's|\n|n |g'
0:00 cat << EOF > ~/.zshrc
HISTFILE=~/.zhistory-test
HISTSIZE=100
SAVEHIST=100
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY # the only change compared to below
EOF
0:00 exec zsh


0:00sleep 1



0:00 exec zsh


Scenario 2: only EXTENDED_HISTORY



$ history -Dn | sed 's|\n|n |g'
0:00 cat << EOF > ~/.zshrc
HISTFILE=~/.zhistory-test
HISTSIZE=100
SAVEHIST=100
setopt EXTENDED_HISTORY
EOF
0:00 exec zsh


0:01sleep 1



0:00 exec zsh


Scenario 3: INC_APPEND_HISTORY and SHARE_HISTORY



Same as scenario 1, but replacing SHARE_HISTORY with INC_APPEND_HISTORY seems to have the same effect.



System info





$ zsh --version



zsh 5.4.2 (x86_64-unknown-linux-musl)


$ ldd /usr/bin/zsh



 /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)
libcap.so.2 => /lib/libcap.so.2 (0x7f0f8acfa000)
libncursesw.so.6 => /lib/libncursesw.so.6 (0x7f0f8aa89000)
libc.so => /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)


$ uname -a



Linux hostname 4.12.13_1 #1 SMP PREEMPT Thu Sep 14 13:15:00 UTC 2017 x86_64 GNU/Linux


$ lsb_release -d



Description: Void Linux









share|improve this question



























    up vote
    2
    down vote

    favorite














    I would like to both share history across terminals and keep track of elapsed time for history commands. The intuitive way seems to be to use both EXTENDED_HISTORY and SHARE_HISTORY, but this sets all elapsed timestamps to 0 after restarting the shell. Is this the correct way to do it? Is it even possible?



    Scenario 1: EXTENDED_HISTORY and SHARE_HISTORY



    $ history -Dn | sed 's|\n|n |g'
    0:00 cat << EOF > ~/.zshrc
    HISTFILE=~/.zhistory-test
    HISTSIZE=100
    SAVEHIST=100
    setopt EXTENDED_HISTORY
    setopt SHARE_HISTORY # the only change compared to below
    EOF
    0:00 exec zsh


    0:00sleep 1



    0:00 exec zsh


    Scenario 2: only EXTENDED_HISTORY



    $ history -Dn | sed 's|\n|n |g'
    0:00 cat << EOF > ~/.zshrc
    HISTFILE=~/.zhistory-test
    HISTSIZE=100
    SAVEHIST=100
    setopt EXTENDED_HISTORY
    EOF
    0:00 exec zsh


    0:01sleep 1



    0:00 exec zsh


    Scenario 3: INC_APPEND_HISTORY and SHARE_HISTORY



    Same as scenario 1, but replacing SHARE_HISTORY with INC_APPEND_HISTORY seems to have the same effect.



    System info





    $ zsh --version



    zsh 5.4.2 (x86_64-unknown-linux-musl)


    $ ldd /usr/bin/zsh



     /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)
    libcap.so.2 => /lib/libcap.so.2 (0x7f0f8acfa000)
    libncursesw.so.6 => /lib/libncursesw.so.6 (0x7f0f8aa89000)
    libc.so => /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)


    $ uname -a



    Linux hostname 4.12.13_1 #1 SMP PREEMPT Thu Sep 14 13:15:00 UTC 2017 x86_64 GNU/Linux


    $ lsb_release -d



    Description: Void Linux









    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite













      I would like to both share history across terminals and keep track of elapsed time for history commands. The intuitive way seems to be to use both EXTENDED_HISTORY and SHARE_HISTORY, but this sets all elapsed timestamps to 0 after restarting the shell. Is this the correct way to do it? Is it even possible?



      Scenario 1: EXTENDED_HISTORY and SHARE_HISTORY



      $ history -Dn | sed 's|\n|n |g'
      0:00 cat << EOF > ~/.zshrc
      HISTFILE=~/.zhistory-test
      HISTSIZE=100
      SAVEHIST=100
      setopt EXTENDED_HISTORY
      setopt SHARE_HISTORY # the only change compared to below
      EOF
      0:00 exec zsh


      0:00sleep 1



      0:00 exec zsh


      Scenario 2: only EXTENDED_HISTORY



      $ history -Dn | sed 's|\n|n |g'
      0:00 cat << EOF > ~/.zshrc
      HISTFILE=~/.zhistory-test
      HISTSIZE=100
      SAVEHIST=100
      setopt EXTENDED_HISTORY
      EOF
      0:00 exec zsh


      0:01sleep 1



      0:00 exec zsh


      Scenario 3: INC_APPEND_HISTORY and SHARE_HISTORY



      Same as scenario 1, but replacing SHARE_HISTORY with INC_APPEND_HISTORY seems to have the same effect.



      System info





      $ zsh --version



      zsh 5.4.2 (x86_64-unknown-linux-musl)


      $ ldd /usr/bin/zsh



       /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)
      libcap.so.2 => /lib/libcap.so.2 (0x7f0f8acfa000)
      libncursesw.so.6 => /lib/libncursesw.so.6 (0x7f0f8aa89000)
      libc.so => /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)


      $ uname -a



      Linux hostname 4.12.13_1 #1 SMP PREEMPT Thu Sep 14 13:15:00 UTC 2017 x86_64 GNU/Linux


      $ lsb_release -d



      Description: Void Linux









      share|improve this question

















      I would like to both share history across terminals and keep track of elapsed time for history commands. The intuitive way seems to be to use both EXTENDED_HISTORY and SHARE_HISTORY, but this sets all elapsed timestamps to 0 after restarting the shell. Is this the correct way to do it? Is it even possible?



      Scenario 1: EXTENDED_HISTORY and SHARE_HISTORY



      $ history -Dn | sed 's|\n|n |g'
      0:00 cat << EOF > ~/.zshrc
      HISTFILE=~/.zhistory-test
      HISTSIZE=100
      SAVEHIST=100
      setopt EXTENDED_HISTORY
      setopt SHARE_HISTORY # the only change compared to below
      EOF
      0:00 exec zsh


      0:00sleep 1



      0:00 exec zsh


      Scenario 2: only EXTENDED_HISTORY



      $ history -Dn | sed 's|\n|n |g'
      0:00 cat << EOF > ~/.zshrc
      HISTFILE=~/.zhistory-test
      HISTSIZE=100
      SAVEHIST=100
      setopt EXTENDED_HISTORY
      EOF
      0:00 exec zsh


      0:01sleep 1



      0:00 exec zsh


      Scenario 3: INC_APPEND_HISTORY and SHARE_HISTORY



      Same as scenario 1, but replacing SHARE_HISTORY with INC_APPEND_HISTORY seems to have the same effect.



      System info





      $ zsh --version



      zsh 5.4.2 (x86_64-unknown-linux-musl)


      $ ldd /usr/bin/zsh



       /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)
      libcap.so.2 => /lib/libcap.so.2 (0x7f0f8acfa000)
      libncursesw.so.6 => /lib/libncursesw.so.6 (0x7f0f8aa89000)
      libc.so => /lib/ld-musl-x86_64.so.1 (0x7f0f8b1d8000)


      $ uname -a



      Linux hostname 4.12.13_1 #1 SMP PREEMPT Thu Sep 14 13:15:00 UTC 2017 x86_64 GNU/Linux


      $ lsb_release -d



      Description: Void Linux






      zsh configuration command-history timestamps






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 8 '17 at 10:04

























      asked Oct 8 '17 at 9:50









      svenper

      18219




      18219

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396809%2fzsh-share-history-or-inc-append-history-breaks-extended-history%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396809%2fzsh-share-history-or-inc-append-history-breaks-extended-history%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay