Ruby Gem 崩鱼 Shell
Ruby Gem Collapse Fish Shell
每当我使用与 gem 相关但不在历史记录中的命令时,它都会破坏终端。在这个例子中,我打算写 'gem check',这是第一次,所以这是发生了什么:
Miguel@MacBook-Pro ~> gem ch
The function call stack limit has been exceeded. do you have an accidental infinite loop?
- (line 1): type -all $argv;
^
in function 'which'
called on line 4 of file /usr/local/Cellar/fish/2.2.0/share/fish/functions/type.fish
with parameter list '-a -- -all'
in command substitution
called on line 2 of file /usr/local/Cellar/fish/2.2.0/share/fish/functions/type.fish
in function 'type'
called on line 1 of file -
with parameter list '-all -a -- -all'
此输出在无限循环中一次又一次地重复。
如果我在之前使用的命令之后写了其他东西,也会发生这种情况。即:gem 更新 -s,-s 部分将获得相同的行为
这里的问题是您有一个名为 which
的别名调用 type
。由于 type
是一个在某些路径中(当使用“-a”调用时)调用 which
的函数,这会导致 "infinite" 循环。
在下一个 fish 版本中,这将通过在 type
函数中调用 command which
来解决。目前,解决方案是删除别名或将其命名为其他名称。
每当我使用与 gem 相关但不在历史记录中的命令时,它都会破坏终端。在这个例子中,我打算写 'gem check',这是第一次,所以这是发生了什么:
Miguel@MacBook-Pro ~> gem ch
The function call stack limit has been exceeded. do you have an accidental infinite loop?
- (line 1): type -all $argv;
^
in function 'which'
called on line 4 of file /usr/local/Cellar/fish/2.2.0/share/fish/functions/type.fish
with parameter list '-a -- -all'
in command substitution
called on line 2 of file /usr/local/Cellar/fish/2.2.0/share/fish/functions/type.fish
in function 'type'
called on line 1 of file -
with parameter list '-all -a -- -all'
此输出在无限循环中一次又一次地重复。
如果我在之前使用的命令之后写了其他东西,也会发生这种情况。即:gem 更新 -s,-s 部分将获得相同的行为
这里的问题是您有一个名为 which
的别名调用 type
。由于 type
是一个在某些路径中(当使用“-a”调用时)调用 which
的函数,这会导致 "infinite" 循环。
在下一个 fish 版本中,这将通过在 type
函数中调用 command which
来解决。目前,解决方案是删除别名或将其命名为其他名称。