Comments (3)
I've read this a couple of times now trying to find an explanation but to no avail. If the $PROFILE is the one that's being used, this should result in a prompt. Can you check the output of $error?
There indeed is an error coming up, but not one I can figure out:
Usage of C:\Tools\oh-my-posh.exe:
invalid value "-pwd" for flag -error: parse error
Override the shell you are working in
-shell string
the path you are working in
-pwd string
Config prints the current settings in json format
-print-config
Error code of previously executed command
-error int
Add the path to a configuration you wish to load
-config string
To me the -pwd
flag looks just fine, it's the same as in the manual and as I stated above.
Using the script you provided works though!
Thanks for the quick reply, sorry for my own late reply.
from oh-my-posh.
I've read this a couple of times now trying to find an explanation but to no avail. If the $PROFILE
is the one that's being used, this should result in a prompt. Can you check the output of $error
?
from oh-my-posh.
@HackXIt can you check the new manual installation guide? There was indeed something off, but the new way of creating the prompt works with the following:
[ScriptBlock]$Prompt = {
$realLASTEXITCODE = $global:LASTEXITCODE
if ($realLASTEXITCODE -isnot [int]) {
$realLASTEXITCODE = 0
}
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "C:\Tools\oh-my-posh.exe"
$startInfo.Arguments = "-config C:\Tools\PoshThemes\powerlevel10k_classic.json -pwd $PWD -error $realLASTEXITCODE"
$startInfo.Environment["TERM"] = "xterm-256color"
$startInfo.CreateNoWindow = $true
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8
$startInfo.RedirectStandardOutput = $true
$startInfo.UseShellExecute = $false
if ($PWD.Provider.Name -eq "FileSystem") {
$startInfo.WorkingDirectory = $PWD
}
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
Set-PoshContext
$process.Start() | Out-Null
$standardOut = $process.StandardOutput.ReadToEnd()
$process.WaitForExit()
$standardOut
$global:LASTEXITCODE = $realLASTEXITCODE
Remove-Variable realLASTEXITCODE -Confirm:$false
}
Set-Item -Path Function:prompt -Value $Prompt -Force
from oh-my-posh.
Related Issues (20)
- Android AArch64 build HOT 1
- iTerm2 shell integration HOT 1
- Ability to not process the command in `command`
- I always lost my customize when I open the new tab HOT 1
- The git segment doesn't render correctly when switching to a shorter branch name HOT 6
- plugin system like "oh-my-zsh" HOT 1
- python segment not working
- Firebase segment does not work on child folders HOT 2
- Line wrapping the time to 2nd line HOT 4
- Loss of appearance when resizing window HOT 1
- Difference between JSON themes schema and documentation HOT 1
- New segment request: Talosctl current context HOT 6
- Improve performance for git prompts (on PowerShell) HOT 6
- shell config error
- When using nushell with --no-history I get error on oh-my-posh.nu HOT 8
- Long command from history disappears during attempt to modification (for slimfat theme)
- Display keyboard and/or mouse battery status HOT 8
- Weird escape characters on the VSCode integrated Terminal HOT 6
- git {{ .BranchStatus }} reports as ≢ even with upstream
- Disabling update checks from the configuration file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oh-my-posh.