13

When pasting text containing tabs into a terminal window, iTerm2 (version 3) asked if I wanted to change the tabs into spaces. I agreed and set that as the default. Now, I need iTerm2 to stop converting the tabs into spaces. How do I do this?

I've looked through the preferences and hidden settings but couldn't find anything obvious. Even the preference to suppress the prompt t convert tabs to spaces is set to "No".

Rob Philipp
  • 241
  • 3
  • 7

3 Answers3

14

Use

defaults write com.googlecode.iterm2 AboutToPasteTabsWithCancel 0

to disable the feature.

10

Preferences -> Advanced -> "Suppress warning about pasting tabs with offer to convert them to spaces".

Enable that to "No" and it will popup again, allowing you to change it (and store if preferred).

Charlie Dalsass
  • 1,986
  • 18
  • 23
3

There is a solution that works for me.
1. Find the path of com.googlecode.iterm2.plist
2. Change the content related to 'PasteTabs' in file com.googlecode.iterm2.plist

The original content is :

  <key>AboutToPasteTabsWithCancel</key>
  <true/>

Change it to :

  <key>AboutToPasteTabsWithCancel</key>
  <false/>
  1. Save the file and restart iTerm2

Now check what you will get when pasting some text contains Tabs.

sel-fish
  • 4,308
  • 2
  • 20
  • 39
  • 1
    I found com.googlecode.iterm2.plist. Unfortunately, it is a binary file on my system...Apparently, iterm2 made a back up of the previous preferences file, and so I reverted to that. Thanks for your help though. – Rob Philipp Jun 13 '16 at 12:04
  • @RobPhilipp There is a way to do this, at the default position, "com.googlecode.iterm2.plist" is binary, but after I save it into a custom folder, it is text file. "Preferences"->"General"->"Preferences", select "Load preferences from a custom..." and select "Save changes to folder when..." – sel-fish Jun 13 '16 at 12:07