Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nice to have: import history at module load #9

Closed
halr9000 opened this issue Sep 9, 2013 · 4 comments
Closed

nice to have: import history at module load #9

halr9000 opened this issue Sep 9, 2013 · 4 comments

Comments

@halr9000
Copy link

halr9000 commented Sep 9, 2013

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.

@frizop
Copy link

frizop commented Sep 10, 2013

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

@lzybkr
Copy link
Member

lzybkr commented Sep 12, 2013

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.

@frizop
Copy link

frizop commented Sep 12, 2013

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
}

@lzybkr
Copy link
Member

lzybkr commented Sep 13, 2013

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants