127 votes
Accepted

iTerm2 (version 3): Individual history per tab?

If you are using zsh, append these two lines to ~/.zshrc after line source $ZSH/oh-my-zsh.sh unsetopt inc_append_history unsetopt share_history From zshoptions(1) - Linux man page : ...
harrymc's user avatar
  • 479k
110 votes

How can I get control+left arrow to go back one word in iTerm2?

Working solution for zsh. Simple, straightforward, out-of-the-box. Goto: ⌘, Preferences → Profiles → Keys → Keyboard Behavior Load Preset: Natural Text Editing
Happy Torturer's user avatar
68 votes
Accepted

Disable autocomplete hints on iTerm2

You can disable the auto command completion by navigating to the following menu: View > Auto command completion
forgetaboutme's user avatar
66 votes

iTerm 2 window resizing

I finally got the answer! ref: https://gitlab.com/gnachman/iterm2/issues/3375 Go to the following menu option: Preferences - Advanced - Windows - Terminal Windows resize smoothly - Yes Holding ...
wklbeta's user avatar
  • 761
66 votes
Accepted

How can I prevent the iTerm2 hotkey window from losing focus?

(If anyone wants the answer as of October 2017) For iTerm2 as of v3.1.3: Open the iTerm Preferences window (Menu bar: iTerm2 > Preferences...) and select Profiles. Select the Hotkey Window profile* ...
Benjamin R's user avatar
53 votes
Accepted

How do I disable the beep/bell sound in iTerm2 in macbook?

To disable the bell sound in iTerm2, do this: iTerm2 -> Preferences -> Profiles Under Terminal tab, you will see Notifications header. Toggle the Silence bell option. EDIT: Please note that ...
rrlamichhane's user avatar
51 votes

Is there a keyboard shortcut to alternate between color schemes in iTerm2

This works on iTerm2 (version, 3.0.8 through 3.0.13) In iTerm's preferences, select the keys tab. There's a table called key mappings click on the + at the bottom of the table Choose a keyboard ...
David D's user avatar
  • 611
47 votes
Accepted

Zsh prompt with current working directory

See the EXPANSION OF PROMPT SEQUENCES and SIMPLE PROMPT ESCAPES sections of the zsh manual page at man zshmisc. This prompt string, PS1='%m %1d$ ', displays the machine name (%m) and the trailing ...
creidhne's user avatar
  • 1,860
47 votes
Accepted

Copy the output of the last command in iTerm2

I figured out the solution: Install Shell Integration: iTerm2 > Install Shell Integration Restart iTerm2 (or just source the script) Run some command that produces output, e.g. pwd Verify that ...
Juuso Ohtonen's user avatar
42 votes
Accepted

Pasting 'required text' into terminal emulator results in '^[[200~required text~'

These characters are used for bracketed paste mode. Some terminal-based programs enable this mode so that they could distinguish pasted text from directly typed text. For example, text editors ...
u1686_grawity's user avatar
36 votes

Where is the .zshrc file on Mac?

The .zshrc file is not present by default in macOS Catalina, we need to create it. Steps for creation: Open Terminal Type touch ~/.zshrc to create the respective file. (touch command will create the ....
iCantC's user avatar
  • 461
36 votes

Zsh prompt with current working directory

The best version of the combinations that works for me is this: PS1='%n@%m %~$ ' %n is the user logged in %m is the machine name %~ gives the path relative to HOME, if path begins with HOME. This is ...
Hardhik's user avatar
  • 461
34 votes

Enter key prints ^M in certain situations in iTerm

This problem occurs because of the odd or old terminal line settings. The stty tool on Unix can help you reset them. I have had the same issue on Iterm2 on Mac and got it fixed using it. stty sane ...
Laksitha Ranasingha's user avatar
30 votes

With Bash + iTerm2, how to name tabs?

I used solutions similar to the above for quite a while, but I use enough tabs that I also want them color-coded for easy visual reference. So I whipped up tabset, a utility to set the tab title, ...
Jonathan Eunice's user avatar
28 votes
Accepted

Is it possible to use vim key bindings in iterm2?

I'm surprised you haven't yet found out about set -o vi This enables the vi editing mode in Bash (to make this permanent put the command in your ~/.bashrc file). Greg's Wiki has a short summary, and ...
Ingo Karkat's user avatar
  • 23.1k
27 votes

Increase/Decrease Font Size in iTerm2

In the current iTerm2 (version 3.3.7), there's View > Size Changes Update Profile which solves the issue: To change the font size regardless of profile, see this iTerm2 issue where a script is ...
Borek Bernard's user avatar
26 votes

How to automatically restore window arrangement from last time in iTerm?

In 2019 (iTerm v3.2.9), what works for me is: Save your current arrangement by clicking CMD + shift + S (or go Window -> Save Window Arrangement. Now go to iTerm2 -> Preferences -> ...
trainoasis's user avatar
25 votes
Accepted

Is there any way to set the default font to 16pts in iTerm2?

You can also add custom values for font sizes. From the Font window, click the gear in the upper left, and choose "Edit Sizes". Then, enter your value.
Justin W.'s user avatar
  • 366
24 votes

ALT+arrow moving between words in zsh and iTerm2

What worked best for me in regards to making iTerm2's command line navigation more intuitive for me (I am a young adult who didn't grow up on a command line, but I've spent a lot of time in text ...
loganjones16's user avatar
24 votes

iTerm command click to open with Atom

(I use this one. For some reason the iTerm option "Open with default app" doesn't work, but the command "$ open whatever" works like a charm, so I've just set that command.
Rene Weteling's user avatar
21 votes

How can I get control+left arrow to go back one word in iTerm2?

I fixed it this way: In top menu; go to Profiles -> Open profiles... -> Edit profiles... (button) -> Keys (tab) -> Load Preset... (dropdown) -> Choose "Natural text editing&...
rassom's user avatar
  • 793
20 votes
Accepted

Select full word in iTerm2 using alt + shift + arrow

Go to Preferences then Keys. Press the +. For the Keyboard Shortcut, press Alt + Shift + ← | → For Alt + Shift + ←, choose "Move Start of Selection Back" and "Move by Word". For ...
Nathan Chapman's user avatar
20 votes
Accepted

How do I move a split pane to a new tab in iterm?

Hold CMD-SHIFT-OPT and drag the pane New Tab -> to the tab bar of a terminal window New Window -> away from the terminal window Source: https://groups.google.com/d/msg/iterm2-discuss/kg_5b3EKCpM/c-...
Dhruvan Ganesh's user avatar
16 votes

iTerm2 (version 3): Individual history per tab?

Extra info to the perfect answer of harrymc. This is not Iterm2 but a feature of zsh which gets activated by default if you use oh-my-zsh (see: https://github.com/robbyrussell/oh-my-zsh/blob/master/...
estani's user avatar
  • 828
15 votes

How to make command+arrow go to begining and end of line in iterm2?

I would say mapping keys manually, as shown in other answers, is an advanced setup. iterm2 already has preset for that. Open Preferences Click "Profile" tab Select a profile in the list ...
Oleg Abrazhaev's user avatar
14 votes

iTerm2 Background image and split panes

Since iTerm version 3.3.0 (in Beta as of June 2019) you have a setting for this: In Preferences > Appearance > Panes un-tick Separate background images per pane
gwenzek's user avatar
  • 241
13 votes

iTerm2 shows up on every Space. How to keep it from doing so?

I've been having the absolute opposite problem of this post. I've rebooted and my iterm settings have the hotkey window set to every space. Anyone else encountering that? edit: It turns out I needed ...
Benjamski's user avatar
  • 161
13 votes
Accepted

Create SIGINT (Signal Interrupt) Shortcut for iTerm2

Preferences » Keys » Key Bindings click + Action: Send Hex Code enter 0x03
anthumchris's user avatar
12 votes

Remote server, iTerm2, and tmux integration

TLDR ssh <hostname> -t 'tmux -CC new -A -s tmssh' Explanation Inside an existing ssh session (assuming you are using iTerm2), you can simply run tmux -CC and a native iTerm2 window will open ...
Adrian Macneil's user avatar
12 votes

Custom iTerm appearance doesn't save after quitting iTerm

You have to save the settings to your profile on the General tab.
Huy Le's user avatar
  • 321

Only top scored, non community-wiki answers of a minimum length are eligible