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

[Question] how to make my config persistent #825

Closed
2 tasks done
saostad opened this issue Jun 30, 2021 · 6 comments
Closed
2 tasks done

[Question] how to make my config persistent #825

saostad opened this issue Jun 30, 2021 · 6 comments

Comments

@saostad
Copy link

saostad commented Jun 30, 2021

Prerequisites

  • I have read and understand the CONTRIBUTING guide
  • I looked for duplicate issues before submitting this one

Description

I have an entry level question.
I have activated a theme and it's great but after I close the terminal and reopen it, it's gone and I have to reactivate the theme, how can I my config persistent.
I already read the docs but couldn't find anything related.

Environment

  • Oh My Posh version:
  • Theme: jandedobbeleer
  • Operating System: Win10 x64
  • Shell: Powershell 7.1.3
  • Terminal: Windows Terminal
@JanDeDobbeleer
Copy link
Owner

@saostad when using Powershell, you can add those lines to your $PROFILE. Powershell loads that file a startup, so adding the following lines there and saving the file will load it again when restarting Powershell.

Import-Module oh-my-posh
Set-PoshPrompt -Theme jandedobbeleer

While this is mentioned in the docs, I understand this can be confusing when you're not familiar with Powershell. You can read up on profiles here.

@saostad
Copy link
Author

saostad commented Jun 30, 2021

thanks, it's working now 🎉🎉🎉🎉

@saostad saostad closed this as completed Jun 30, 2021
@BoisonChang
Copy link

BoisonChang commented May 10, 2022

@saostad when using Powershell, you can add those lines to your $PROFILE. Powershell loads that file a startup, so adding the following lines there and saving the file will load it again when restarting Powershell.

Import-Module oh-my-posh
Set-PoshPrompt -Theme jandedobbeleer

While this is mentioned in the docs, I understand this can be confusing when you're not familiar with Powershell. You can read up on profiles here.

I follow instruction show docs page in terminal :

and then two question happen:

1 why this docs page recommend Delete the import of the PowerShell module in your $PROFILE?

2 after finishing the Migration steps in docs page , terminal can't read "import oh-my-posh" written in $PROFILE.

like that:

Import-Module : The specified module 'oh-my-posh' was not loaded because no valid module file was found in any module directory.
At C:\Users\Boison Chang\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:2 char:1

  • Import-Module oh-my-posh
  •   + CategoryInfo          : ResourceUnavailable: (oh-my-posh:String) [Import-Module], FileNotFoundException
      + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
    
    

Set-PoshPrompt : The term 'Set-PoshPrompt' is not recognized as the name of a cmdlet, function, script file, or operable program. Check t
he spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Boison Chang\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:3 char:1

  • Set-PoshPrompt -Theme paradox
  •   + CategoryInfo          : ObjectNotFound: (Set-PoshPrompt:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    
    

@JanDeDobbeleer
Copy link
Owner

@saostad please follow every step in that page. Read it again, carefully, and execute every command/step listed. That way your prompt will work correctly.

@BoisonChang
Copy link

@saostad please follow every step in that page. Read it again, carefully, and execute every command/step listed. That way your prompt will work correctly.

OK, Thank you. I will try carefully again.

Copy link

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants