mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
refactor: align debug functionality cross shell
This commit is contained in:
parent
3a15594410
commit
f937f28545
4
.github/ISSUE_TEMPLATE/bug.yml
vendored
4
.github/ISSUE_TEMPLATE/bug.yml
vendored
|
@ -56,7 +56,7 @@ body:
|
||||||
id: logs
|
id: logs
|
||||||
attributes:
|
attributes:
|
||||||
label: Log output
|
label: Log output
|
||||||
description: Please copy and paste the output generated by `Write-PoshDebug (PowerShell)`, or `oh-my-posh debug` for other shells.
|
description: Please copy and paste the output generated by `oh-my-posh debug`.
|
||||||
render: shell
|
render: Shell
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
|
@ -21,34 +21,21 @@ Before validating anything, make sure you're on the [latest version][latest] of
|
||||||
}>
|
}>
|
||||||
<TabItem value="powershell">
|
<TabItem value="powershell">
|
||||||
|
|
||||||
You can use the `Write-PoshDebug` function to see where Oh my posh spends its time.
|
You can use the `oh-my-posh debug` functionality to see where Oh My Posh spends its time.
|
||||||
In case there's no clear culprit (timings indicate everything's OK), chances are some modules are the culprit.
|
In case there's no clear culprit (timings indicate everything's OK), chances are some modules are the culprit.
|
||||||
We bootstrap afew PowerShell modules to maximise compatibility, but sometimes these can introduce unwanted side-effects.
|
We bootstrap a few PowerShell modules to maximise compatibility, but sometimes these can introduce unwanted side-effects.
|
||||||
|
|
||||||
The modules we support are:
|
The modules we support are:
|
||||||
|
|
||||||
- posh-git
|
- posh-git
|
||||||
- Az.Accounts
|
|
||||||
|
|
||||||
Especially the latter can slow things down so the first thing to do is disable that one:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$env:AZ_ENABLED=$false
|
|
||||||
```
|
|
||||||
|
|
||||||
Once added, reload your profile for the changes to take effect.
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
. $PROFILE
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="others">
|
<TabItem value="others">
|
||||||
|
|
||||||
You can use the Oh My Posh's built-in `--debug` flag to identify slow segments.
|
You can use Oh My Posh's built-in debug functionality to identify slow segments.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
oh-my-posh --config ~/.mytheme.omp.json --debug --shell uni
|
oh-my-posh debug
|
||||||
```
|
```
|
||||||
|
|
||||||
Whenever there's a segment that spikes, see if there might be updates to the underlying functionality (usually shell commands).
|
Whenever there's a segment that spikes, see if there might be updates to the underlying functionality (usually shell commands).
|
||||||
|
|
|
@ -124,10 +124,6 @@ function global:Initialize-ModuleSupport {
|
||||||
}
|
}
|
||||||
Set-Item -Path Function:prompt -Value $Prompt -Force
|
Set-Item -Path Function:prompt -Value $Prompt -Force
|
||||||
|
|
||||||
function global:Write-PoshDebug {
|
|
||||||
@(Start-Utf8Process "::OMP::" "debug") -join "`n"
|
|
||||||
}
|
|
||||||
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Exports the current oh-my-posh theme
|
Exports the current oh-my-posh theme
|
||||||
|
|
Loading…
Reference in a new issue