Mojave: Pasting text with control characters

keyboardterminal

I use git from within Terminal.app, and will occasionally end up (particularly after a merge resolution) with something like:

$ git status
  ...
  Untracked files:
      foo/bar/baz.orig

Where the whitespace before foo is a tab character.

Since Mojave, copying and pasting that line (which I want to do to rm the file) results in an alert (complete with loud bonk) asking me to confirm whether I want to paste the nasty control characters.

Anyone know if either:

  1. there's a way to disable the alert and just paste with the control
    characters, or
  2. there's a keyboard shortcut to paste without the control
    characters?

FWIW, I understand that there are other ways to remove the file (e.g. git status|grep orig$|xargs rm) and I understand why, in the general case, you'd want to limit pasting of control characters.

Best Answer

Update your OS to 10.14.1 or later

It seems that Terminal in 10.14 would present this dialog when pasting a tab character, but the updated Terminal in 10.14.1 and 10.14.2 does not.

I was scratching my head as to why I was only able to reproduce this issue on one install but not another. Unable to find any settings that had any impact, I eventually tried updating the machine that showed the dialog, and it was gone.