gpt4 book ai didi

zsh - 在 shell 中启动交互式命令时 Enter 不起作用

转载 作者:行者123 更新时间:2023-12-04 14:38:06 25 4
gpt4 key购买 nike

在 term 中的某些操作之后, enter 停止在 shell 中使用交互式命令 - 我仍然能够启动一个命令,但如果该命令需要额外的输入,则在 '^M' 处插入换行符。

例子:

$ git add -p .
diff --git a/app/models/coupon.rb b/app/models/coupon.rb
index 39df1f3..736ea62 100644
--- a/app/models/coupon.rb
+++ b/app/models/coupon.rb
@@ -3,6 +3,7 @@ class Coupon < ActiveRecord::Base
COUPON_PRECREATE_EXPIRATION_BUFFER = 5.days
COUPON_PRECREATE_COUNT = 15

+ include CommonNamedScopes

belongs_to :coupon_list
#belongs_to :couponable, :polymorphic => true
Stage this hunk [y,n,q,a,d,/,e,?]? y^M

(例如,在使用 cat 时可以实现同样的问题)所以它与 git 没有关系。 .

有人可以建议为什么会这样吗?

iTerm2 构建 1.0.0.20120724

zsh 5.0.0 (x86_64-apple-darwin11.4.2)

最佳答案

这通常是因为程序更改了终端的状态,但没有将其更改回来。

尝试运行 reset命令,看看是否能解决问题。

由于您使用的是 zsh,您也可以使用 ttyctl -f在命令运行后让 zsh 自动重置终端设置。但是在首先重置终端之前不要使用它,否则 zsh 会将设置卡住在损坏状态。

关于zsh - 在 shell 中启动交互式命令时 Enter 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13746216/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com