Skip to content

nice to have: import history at module load #9

Closed

Description

I noticed right off that my (ghy).length is greater than the scrollback buffer after loading psreadline. Would be cool if it were to grab everything in the history buffer, especially if I'm doing something outside of my session to persist these.

Activity

  1. frizop commented on Sep 10, 2013

    @frizop

    This was my very first concern with the module, besides that love it

  2. lzybkr commented on Sep 12, 2013

    @lzybkr
    Contributor

    Great idea. I was considering maintaining history automatically, but I can easily add this feature and add automatic saving of history (ideally shared across sessions) later.

  3. frizop commented on Sep 12, 2013

    @frizop

    I pulled out the stuff from posh for persistent history found in my profile:

    param(

    Controls how much history we keep in the command log

    [Int]$PersistentHistoryCount = 1024,

    If set, we use a pasteable prompt with <# #> around the prompt info

    [Alias("copy","demo")][Switch]$Pasteable,
    [Int]$global:MaximumHistoryCount = 2048,
    [ConsoleColor]$global:PromptForeground = "Yellow",
    [ConsoleColor]$global:ErrorForeground = "Red"
    )

    Global first-run (profile or first prompt)

    if($MyInvocation.HistoryId -eq 1) {
    $ProfileDir = Split-Path $Profile.CurrentUserAllHosts

    Import my history

    Import-CSV $ProfileDir.poshhistory | Add-History
    }

  4. lzybkr commented on Sep 13, 2013

    @lzybkr
    Contributor

    History should now be imported when you load the module - commit 1c75b8e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions