2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

iterm2でエンターを押すと^Mと出力されて改行できない

Posted at

何言ってるかわからねえと思うが、
僕の場合は、itermの窓で、

bundle exec rails server -p 3000

を実行させてて、コンソールログを眺めてたわけです。

ログの境目をわかりやすくするために処理を実行させる前に、エンターを連打して改行をいれようと思ったら、

^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M

は?ww

対処法

いったん、rails serverを切って、ターミナル上で

stty sane

のコマンドを叩けば解決です。

説明(僕なりの解釈)

何かしらの理由でターミナル上の特殊文字を変更(今回でいうと^M?)されたんだけど、通常であれば変更後、それをデフォルトに戻すはずが何かしらの理由でそれが戻されず、^Mが表示されるようになってしまったのではないかと。

僕の場合容疑者は、rails serverかtmuxのコピーモードのどっちかだと思う・・・w(エンターの挙動が変わりそうなのはコピーモードっぽいので後者かな・・・)

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?