自定义bash终端显示信息

alias __git_current_commit='git log --pretty=format:%h -1'

alias __git_current_branch='git rev-parse --abbrev-ref HEAD >& /dev/null && echo " (git rev-parse --abbrev-ref HEAD -> __git_current_commit)"'

update_ps1() {

PS1='\033[1;36m\u@\h:\033[1;32m\wKaTeX parse error: Undefined control sequence: \0 at position 19: ...rse_git_branch)\̲0̲33[0m (\t)\n'

}

PROMPT_COMMAND=update_ps1

export PS1

相关推荐
门前云梦3 小时前
《C语言·源初法典》---C语言基础(上)
c语言·开发语言·学习
sjtu_cjs4 小时前
Tensorrt python api 10.11.0笔记
开发语言·笔记·python
哆啦A梦的口袋呀4 小时前
深入理解系统:UML类图
开发语言·python·uml
虎冯河4 小时前
怎么让Comfyui导出的图像不包含工作流信息,
开发语言·python
coding随想4 小时前
JavaScript中的原始值包装类型:让基本类型也能“变身”对象
开发语言·javascript·ecmascript
2301_794333914 小时前
Maven 概述、安装、配置、仓库、私服详解
java·开发语言·jvm·开源·maven
葬爱家族小阿杰5 小时前
python执行测试用例,allure报乱码且未成功生成报告
开发语言·python·测试用例
酷爱码5 小时前
Python实现简单音频数据压缩与解压算法
开发语言·python
keepquietl5 小时前
MQTT示例体验(C)
c语言·开发语言