7
1

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 5 years have passed since last update.

iTerm2で複数行のコピペ(貼り付け)の際にアラートを!

Posted at

iTerm2でコピペしたものを貼り付けた際に複数行あやまってペーストしてしまった場合に警告を出し、誤操作を防ぐ。

作業中あやまって複数の更新クエリを流してしまったなどを防ぐために行う。

最初はトリガ機能で改行コードを正規表現で発見しアラート表示させようかとしたが失敗なぜかうまくいかない。。。

色々いじってた所シンプルにiTerm2の機能で、複数行コピペは警告が出せることを知った。。。

肝心の設定は「Edit」→「Paste Special」で設定可能。

1571482110943.png

この上記画像のチェックの入っている箇所に注目する。(デフォルトではこの三つにチェックが入っているはず)
『Warn Before Multi-Line Paste』 :複数行の貼り付け前に警告する
『Limit Multi-Line Paste Warning to Shell Prompt』 :複数行の貼り付けの警告をシェルプロンプトに制限する
『Warn Before pasting One Line Ending in a Newline at Shell Prompt』 :シェルプロンプトで改行で終わる1行を貼り付ける前に警告する
(By Google翻訳)

なので、『Limit Multi-Line Paste Warning to Shell Prompt』のチェックを外すとOK
複数行貼り付け時に警告が出る!!

1571482764804.png

これで安心安全のiTerm2生活が送れます。。。
この前ほんと変な文章をサーバー上でコピペして貼ってしまった時は死ぬかと思った。。。

以上!!

7
1
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
7
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?