You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Debian下配置fish/tide提示符仅显示当前目录名(保留美化样式)

解决Tide提示符仅显示当前目录名(保留原有美化样式)

环境信息

  • 系统:Debian
  • Fish Shell版本:3.6.1
  • Tide提示符版本:5.5.1
  • 已配置的Tide参数:
    • Prompt Style: Rainbow
    • Prompt Colors: True color
    • Show current time?: No
    • Prompt Separators: Vertical
    • Prompt Heads: Blurred
    • Prompt Tails: Blurred
    • Prompt Height: One line
    • Prompt Spacing: Sparse
    • Icons: Many icons

解决方案

不要用basename直接替换路径(会丢失样式),使用Tide原生配置项即可保留所有美化效果:

方法1:通过Tide配置向导修改

执行命令启动配置流程:

tide configure

在向导中找到**"PWD style"选项,选择"Current directory only"**,完成后续步骤保存配置即可。

方法2:直接设置Tide变量(快速生效)

在你的自定义配置文件~/.config/fish/conf.d/10-camechi-config.fish末尾添加以下代码:

# 配置Tide仅显示当前目录名
set -g tide_pwd_style current

保存文件后,重启fish shell或执行source ~/.config/fish/config.fish使配置生效。

说明

Tide的tide_pwd_style变量支持三种路径显示模式:

  • full: 显示完整路径(默认)
  • short: 家目录用~缩写,其他目录使用首字母缩写
  • current: 仅显示当前目录名

使用原生配置变量会完整保留Tide的颜色、图标、分隔符等美化样式,避免手动替换路径导致的格式丢失问题。

内容的提问来源于stack exchange,提问作者CAmechi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 02:12:54