浏览代码

Do not print newline for prompt if not in a git repo

DricomDragon 5 年之前
父节点
当前提交
3fb5f75637
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Install/Templates/fish/functions/fish_prompt.fish

+ 3 - 1
Install/Templates/fish/functions/fish_prompt.fish

@@ -22,7 +22,9 @@ function fish_prompt --description 'Write out the prompt'
 
 	# Newline on tiny screens
 	if test $COLUMNS -lt 50
-		echo
+		if git rev-parse --is-inside-work-tree &> /dev/null
+			echo
+		end
 	end
 
     __terlar_git_prompt