oh-my-posh/website/docs/segments/iterm.mdx
2024-04-30 16:33:55 +02:00

66 lines
1.7 KiB
Plaintext

---
id: iterm
title: iTerm
sidebar_label: iTerm
---
## What
Inserts iTerm2 shell integration prompt marks and extensions. This segment has no visible output
but is used to enable iTerm2 terminal features.
For more information, read the [shell integration][int-page] and [extension page][ext-page] on
the developer's website.
:::info PromptMark in Bash and ZSH
You will need to add `export ITERM2_SQUELCH_MARK=1` before the shell integration script is sourced.
:::
:::info PromptMark in Fish shell
For fish, you can make use of Oh My Posh's `set_poshcontext` function to set the prompt mark. Add the
following line after initialising Oh My Posh:
```fish
function set_poshcontext
iterm2_prompt_mark
end
```
You do not need to add this segment to use the prompt mark.
:::
## Sample Configuration
import Config from "@site/src/components/Config.js";
<Config
data={{
type: "iterm",
interactive: true,
style: "plain",
foreground: "#80ffea",
template: "{{ .PromptMark }}",
}}
/>
## Template ([info][templates])
:::note default template
```template
{{ .PromptMark }}
```
:::
### Properties
| Name | Type | Description |
| ------------- | -------- | --------------------------------------------------- |
| `.PromptMark` | `string` | inserts the prompt mark to enable shell integration |
| `.CurrentDir` | `string` | inserts the current directory |
| `.RemoteHost` | `string` | inserts the current user and host name |
[templates]: /docs/configuration/templates
[int-page]: https://iterm2.com/documentation-shell-integration.html
[ext-page]: https://iterm2.com/documentation-escape-codes.html