mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
f47da9592f
commit
0af3029cf1
|
|
@ -70,8 +70,8 @@ func runInit(shellName string) {
|
||||||
shell.ShellIntegration = cfg.ShellIntegration
|
shell.ShellIntegration = cfg.ShellIntegration
|
||||||
for i, block := range cfg.Blocks {
|
for i, block := range cfg.Blocks {
|
||||||
// only fetch cursor position when relevant
|
// only fetch cursor position when relevant
|
||||||
if i == 0 && block.Newline {
|
if !cfg.DisableCursorPositioning && (i == 0 && block.Newline) {
|
||||||
shell.Cursor = true
|
shell.CursorPositioning = true
|
||||||
}
|
}
|
||||||
if block.Type == engine.RPrompt {
|
if block.Type == engine.RPrompt {
|
||||||
shell.RPrompt = true
|
shell.RPrompt = true
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ type Config struct {
|
||||||
ShellIntegration bool `json:"shell_integration,omitempty"`
|
ShellIntegration bool `json:"shell_integration,omitempty"`
|
||||||
PWD string `json:"pwd,omitempty"`
|
PWD string `json:"pwd,omitempty"`
|
||||||
Var map[string]interface{} `json:"var,omitempty"`
|
Var map[string]interface{} `json:"var,omitempty"`
|
||||||
|
DisableCursorPositioning bool `json:"disable_cursor_positioning,omitempty"`
|
||||||
|
|
||||||
// Deprecated
|
// Deprecated
|
||||||
OSC99 bool `json:"osc99,omitempty"`
|
OSC99 bool `json:"osc99,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ var (
|
||||||
Tooltips bool
|
Tooltips bool
|
||||||
ShellIntegration bool
|
ShellIntegration bool
|
||||||
RPrompt bool
|
RPrompt bool
|
||||||
Cursor bool
|
CursorPositioning bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func getExecutablePath(env platform.Environment) (string, error) {
|
func getExecutablePath(env platform.Environment) (string, error) {
|
||||||
|
|
@ -270,7 +270,7 @@ func PrintInit(env platform.Environment) string {
|
||||||
"::TOOLTIPS::", toggleSetting(Tooltips),
|
"::TOOLTIPS::", toggleSetting(Tooltips),
|
||||||
"::FTCS_MARKS::", toggleSetting(ShellIntegration),
|
"::FTCS_MARKS::", toggleSetting(ShellIntegration),
|
||||||
"::RPROMPT::", strconv.FormatBool(RPrompt),
|
"::RPROMPT::", strconv.FormatBool(RPrompt),
|
||||||
"::CURSOR::", strconv.FormatBool(Cursor),
|
"::CURSOR::", strconv.FormatBool(CursorPositioning),
|
||||||
"::UPGRADE::", strconv.FormatBool(hasNotice),
|
"::UPGRADE::", strconv.FormatBool(hasNotice),
|
||||||
"::UPGRADENOTICE::", notice,
|
"::UPGRADENOTICE::", notice,
|
||||||
).Replace(script)
|
).Replace(script)
|
||||||
|
|
|
||||||
|
|
@ -3269,6 +3269,12 @@
|
||||||
"description": "https://ohmyposh.dev/docs/configuration/overview#general-settings",
|
"description": "https://ohmyposh.dev/docs/configuration/overview#general-settings",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
"disable_cursor_positioning": {
|
||||||
|
"type": "boolean",
|
||||||
|
"title": "Disable Cursor Positioning",
|
||||||
|
"description": "https://ohmyposh.dev/docs/configuration/overview#general-settings",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
"shell_integration": {
|
"shell_integration": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"title": "FTCS command marks for shell integration",
|
"title": "FTCS command marks for shell integration",
|
||||||
|
|
|
||||||
|
|
@ -127,13 +127,14 @@ For example, the following is a valid `--config` flag:
|
||||||
## General Settings
|
## General Settings
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| --------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `final_space` | `boolean` | when true adds a space at the end of the prompt |
|
| `final_space` | `boolean` | when true adds a space at the end of the prompt |
|
||||||
| `pwd` | `string` | notify terminal of current working directory, values can be `osc99`, `osc7`, or `osc51` depending on your terminal |
|
| `pwd` | `string` | notify terminal of current working directory, values can be `osc99`, `osc7`, or `osc51` depending on your terminal |
|
||||||
| `terminal_background` | `string` | [color][colors] - terminal background color, set to your terminal's background color when you notice black elements in Windows Terminal or the Visual Studio Code integrated terminal |
|
| `terminal_background` | `string` | [color][colors] - terminal background color, set to your terminal's background color when you notice black elements in Windows Terminal or the Visual Studio Code integrated terminal |
|
||||||
| `accent_color` | `string` | [color][colors] - accent color, used as a fallback when the `accent` [color][accent] is not supported |
|
| `accent_color` | `string` | [color][colors] - accent color, used as a fallback when the `accent` [color][accent] is not supported |
|
||||||
| `var` | `map[string]any` | config variables to use in [templates][templates]. Can be any value |
|
| `var` | `map[string]any` | config variables to use in [templates][templates]. Can be any value |
|
||||||
| `shell_integration` | `boolean` | enable shell integration using FinalTerm's OSC sequences. Works in bash, cmd (Clink v1.14.25+), fish, powershell and zsh |
|
| `shell_integration` | `boolean` | enable shell integration using FinalTerm's OSC sequences. Works in bash, cmd (Clink v1.14.25+), fish, powershell and zsh |
|
||||||
|
| `disable_cursor_positioning` | `boolean` | disable fetching the cursor position in bash and zsh in case of unwanted side-effects |
|
||||||
|
|
||||||
### JSON Schema Validation
|
### JSON Schema Validation
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue