mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-26 10:31:20 -08:00
fix: switch for OSC99
This commit is contained in:
parent
853eaa3890
commit
87af930b75
|
@ -53,6 +53,7 @@ boxes with question marks, [set up your terminal][setupterm] to use a supported
|
|||
## General Settings
|
||||
|
||||
- final_space: `boolean` - when true adds a space at the end of the prompt
|
||||
- osc99: `boolean` - when true adds support for OSC9;9; (notify terminal of current working directory)
|
||||
- console_title: `boolean` - when true sets the current location as the console title
|
||||
- console_title_style: `string` - the title to set in the console - defaults to `folder`
|
||||
- console_title_template: `string` - the template to use when `"console_title_style" = "template"`
|
||||
|
|
|
@ -164,11 +164,12 @@ func (e *engine) render() {
|
|||
e.renderer.write(" ")
|
||||
}
|
||||
|
||||
if !e.settings.OSC99 {
|
||||
e.print()
|
||||
return
|
||||
}
|
||||
cwd := e.env.getcwd()
|
||||
|
||||
// temp to fix 3.89 issue and add wsl support
|
||||
if e.env.isWsl() {
|
||||
// transform path
|
||||
cwd, _ = e.env.runCommand("wslpath", "-m", cwd)
|
||||
}
|
||||
e.renderer.osc99(cwd)
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
// Settings holds all the theme for rendering the prompt
|
||||
type Settings struct {
|
||||
FinalSpace bool `json:"final_space"`
|
||||
OSC99 bool `json:"osc99"`
|
||||
ConsoleTitle bool `json:"console_title"`
|
||||
ConsoleTitleStyle ConsoleTitleStyle `json:"console_title_style"`
|
||||
ConsoleTitleTemplate string `json:"console_title_template"`
|
||||
|
|
|
@ -1356,6 +1356,12 @@
|
|||
"description": "https://ohmyposh.dev/docs/configure#general-settings",
|
||||
"default": true
|
||||
},
|
||||
"osc99": {
|
||||
"type": "boolean",
|
||||
"title": "Enable OSC99",
|
||||
"description": "https://ohmyposh.dev/docs/configure#general-settings",
|
||||
"default": false
|
||||
},
|
||||
"console_title": {
|
||||
"type": "boolean",
|
||||
"title": "Console Title",
|
||||
|
|
Loading…
Reference in a new issue