4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Emacsで貼り付けすると~200~201が挿入されてしまう問題

4
Last updated at Posted at 2017-10-14

Emacsでペースト(yankでなく)すると何故か先頭に~200、末尾付近に~201が挿入されるようになってしまっていた。
検索すると既知のバグだったようで英語のStackExchangeの回答が見つかった。
日本語の情報が引っかからなかったので日本語で残しておく。

解決方法

M-[に何かのキーバインドを設定しているならそれを消す。
これだけで直った。
どうも特殊なイベントのためのフック関係で妙な挙動になるらしく、それが原因らしい。

おわり

私の水晶玉によると、という言い回しが面白かった。

追記

これはどうやらブラケテッドペーストモードというものによるものらしく、シェルでペーストした際にペーストした内容が勝手に実行されないように指定したりするためのものらしい。
wikiに詳しく書いてある。
^[[200~とか\e[200~みたいな表示のされ方になるようだ。
bracketed-pasteで検索すると色々出てくると思う。
^[[?2004hなんかもこれの関係。

4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?