cmder slow issue(在较大git仓库下相应缓慢)

cmder 是一款强大的命令行工具, 可以在windows 上执行一些Linux的常用指令,如 rm, ls, grep 等等(安装full版本或独立安装git, 这些命令一般在git中). 很值得推荐. 不过如果系统中安装了git, 且当前命令行文件夹中存在的git仓库较大时候,输入回车和执行一些指令就会比较慢. 以下是一个临时的解决办法. 我测试了还是效果比较明显的. 

temperory solution:
comment these codes in local function git_prompt_filter() in clink.lua under cmder\vendor folder:

local git_dir = get_git_dir()
if git_dir then
	-- if we're inside of git repo then try to detect current branch
	local branch = get_git_branch(git_dir)
	local color
	if branch then
		-- Has branch => therefore it is a git folder, now figure out status
		local gitStatus = get_git_status()
		local gitConflict = get_git_conflict()

		color = colors.dirty
		if gitStatus then
			color = colors.clean
		end

		if gitConflict then
			color = colors.conflict
		end 

		clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..branch..")")
		return false
	end
end

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值