在 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/