跳转到主内容

分享主题

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

你可以将提示符导出为图片并在线分享。你还能调整图片的对齐方式,并添加自己的名字作为署名。

注意

某些符号可能无法正确渲染,这不是你的问题而是渲染器的限制。根据你的配置,可能需要微调输出效果。

oh-my-posh 可执行文件提供 config export image 命令,可将当前主题配置导出为 PNG 图片(默认使用配置文件名称,未指定时则为 prompt.png)。

oh-my-posh config export image

设置文件

--settings 参数允许提供 JSON 文件来自定义导出图片。该文件可覆盖颜色配置、设置作者名称以及指定背景色。

~/.image.settings.json
{
"colors": {
"red": "#FF6B6B",
"blue": "#4ECDC4",
"green": "#45B7D1",
"yellow": "#FFA07A",
"magenta": "#98D8C8",
"cyan": "#F7DC6F"
},
"fonts": {
"regular": "C:/Users/user/Downloads/BigBlueTerminal/BigBlueTerm437NerdFont-Regular.ttf",
"bold": "C:/Users/user/Downloads/BigBlueTerminal/BigBlueTerm437NerdFont-Regular.ttf",
"italic": "C:/Users/user/Downloads/BigBlueTerminal/BigBlueTerm437NerdFont-Regular.ttf"
},
"author": "Your Name",
"background_color": "#282828",
"cursor": "\udb81\udde7"
}

设置选项

NameTypeDefaultDescription
colorsobjectMap of ANSI color names to hex color codes. See 16 ANSI color names
authorstringYour name or credit to display on the image
background_colorstring#151515Hex code for the image background
fontsobjectFont settings for the image, including regular, bold, and italic styles
cursorstring_A custom cursor

使用方法

oh-my-posh config export image --settings ~/.image.settings.json

此操作将使用文件中的自定义颜色和设置导出提示符图片。