Questions tagged [iterm2]
iTerm2 is an open source Terminal replacement for OS X
334
questions
0
votes
0
answers
6
views
How to get and pass the trigger captured text to a script function invocation in iTerm2? [migrated]
I was trying to add a trigger to capture text in some pattern and pass it to a Python script
My script is:
#!/usr/bin/env python3
import iterm2
async def main(connection):
@iterm2.RPC
async ...
0
votes
0
answers
17
views
Faster way to send CMD+number in bash than osascript
I’m currently sending the following command in Bash (on Mac):
osascript -e ‘tell application “System Events” to keystroke “$TERMINAL_NUMBER” using {command down}
While this does exactly what I want. ...
0
votes
0
answers
12
views
Applescript to receive and translate keystroke
My AppleScript will launch with iTerm2 and be a window management script. It will be a little bit complex, but in essence I want it to translate CMD+<letter> to CMD+<number>. So a minimal ...
0
votes
0
answers
24
views
How to close a tab in iterm2
I am using iTerm2 on mac. I am unable to close the tab using cmd+W. I tried to find a way to manually add a shortcut to close a tab but I couldn't find any such action in Preference-> keys-> key ...
0
votes
0
answers
94
views
How to change the font color in the title of iTerm 2?
Does anyone know what option should I put in .zshrc to change the font color in the title of iTerm from grey to white? I spent 24h and still couldn't find the right option because there are a lot of ...
0
votes
0
answers
122
views
Git colors not displaying in terminal
Text in both the default terminal and iTerm2 are plain white when running git commands and I want it to be properly colorized.
I've reviewed this question and this question and verified the following:
...
1
vote
0
answers
22
views
Is it possible to set the default iTerm profile using CLI?
I'm trying to write a MacOS provisioning script for iTerm2 which will (1) load in a dynamic profile and (2) set it to use as the default profile.
Loading the profile is just a matter of putting it in ...
0
votes
1
answer
60
views
iTerm2 clear screen should not delete output of running command
When I used command + k the output of the actual running command was not cleared. Now with my new MacBook I don't know how to set this feature again. Has anyone an idea?
2
votes
1
answer
88
views
Is it possible to set separate fish color configurations for light and dark system theme?
I use a terminal (Iterm2 Beta) that allows you to set a separate theme for light and dark mode. This is useful for changing the background color of the terminal, and the contrast of the various preset ...
0
votes
0
answers
8
views
How to only select commands from hints in iterm2?
I know how to enable/disable autocomplete command hints in iterm2 on my MacBook Pro Early 2015.
Whenever I press enter to select commands from hints, iterm executes them as well. I want to edit those ...
0
votes
0
answers
66
views
In Iterm2, can I have a new window start the prompt and cursor at the bottom of the window?
I frequently clear my Iterm2 window (⌘-K) or open a new tab before starting a long-running task. I would like the new tab to have the command prompt and cursor at the bottom of the window, not the top....
7
votes
1
answer
4k
views
How do I disable the beep/bell sound in iTerm2 in macbook?
The shell in macbook makes annoying beep/bell/boop sounds.
For the OEM terminal, this answer works on disabling this annoying sounds:
https://stackoverflow.com/questions/19166539/i-want-to-disable-...
1
vote
0
answers
646
views
Why running iTerm2 the first time installs pip3?
When iTerm2 is run for the first time on a Mac, it starts installing pip3. I am trying to understand why.
In my case I was on a slow network and the install would have take 3 hours, so I stopped the ...
0
votes
0
answers
38
views
iTerm tmux session unable to click in w3m browser
After running tmux -CC within iTerm2, I launch w3m. Usually I am able to use the mouse to interact by double clicking on links. I cannot however double click when running tmux. I have tried clicking ...
0
votes
0
answers
34
views
How can I view more of my history in Screen on MAC?
I have a screen on iTerm on my MAC that printed out a lot of important messages. I didn't set the scrollback buffer to be unlimited unfortunately. How can I view more messages from my current screen ...
0
votes
0
answers
34
views
ohmyzsh git prompt: how to configure to show in git prompt committed but not pushed?
macOS
Installed:
ITerm2
Ohmyzsh with default plugins; go through all the steps by running p10k config
Git prompt is working as expected except for one issue: the prompt does not show committed but ...
0
votes
0
answers
20
views
Starting a workspace in iTerm2 automatically on MacOS
Goal
I want to have a command (running a script/hotkey/alfred workflow) to start my work day with a running workspace. I'm having trouble on the running the stack part.
the goal is having 3 panes with ...
0
votes
1
answer
173
views
Can't open files in Sublime Text 4 by clicking on paths in iTerm2 after upgrade
I just upgraded Sublime Text 3 to Sublime Text 4. (and love it!)
Now, I can no longer click on filepaths in iTerm2 and have them open in Sublime. I didn't notice for a few days, so I didn't ...
0
votes
0
answers
20
views
Control-C adds characters to history
I'm using ITerm2 3.4.6 on Mac 11.2.2 ( though I've experienced this same issue with other versions of OS/ITerm2 )
I found that using Control-C to cancel a command will add characters to the "up ...
1
vote
1
answer
146
views
How to map Command key to Control key when using iTerm
I already mapped "Caps Lock" key to "Command" key using System Prefrences of macOS, as I use "Command" key frequently when using most application.
When using iTerm2, I ...
0
votes
1
answer
90
views
With PowerShell set iTerm2 tab title
I'm using PowerShell as my shell with iTerm2 on macOS.
I know it's possible on bash and zsh but running the recommended solution doesn't work in powershell, because the ANSI escape doesn't work:
PS ~&...
0
votes
0
answers
102
views
Cannot open new tabs or windows in iTerm2 after upgrading to Bug Sur
After upgrading to Big Sur (11.2), I can no longer open new tabs (Command+T) or windows (Command+N). iTerm2 flickers, but nothing happens. I also cannot split.
I can still duplicate an existing tab ...
1
vote
1
answer
51
views
Add Additional Content to Paste
(I'm using iTerm2 on MacOS, also have a Debian Linux machine)
Does anyone know of a way to paste content that would include some boilerplate text around whatever the actual contents of clipboard is? ...
0
votes
0
answers
141
views
Why would iTerm2 need to record the computer's screen?
I finally installed iTerm2 on my Mac to improve my efficiency working in the terminal. Right out of the box it's been great. I got a popup saying "iTerm would like to record this computer's ...
2
votes
2
answers
4k
views
"No such file or directory: ~/.oh-my-zsh/oh-my-zsh.sh" even though file exists
I was trying to transfer my terminal setup (iTerm2, zsh, oh-my-zsh, omz themes) from an old MacBook to a new one.
.zshrc real file is in Dropbox shared between the two laptops, and in each laptop ...
0
votes
1
answer
741
views
iTerm2 + oh-my-bash: iTerm2 shell-integration not working
I cannot get iTerm2's shell integration work with oh-my-bash. I already tried the suggestions in the existing posts but without luck. My configuration looks as follow:
iTerm2 profile
General -> ...
2
votes
1
answer
518
views
Garbage characters are printed on mouse scrolling on iTerm2
Sometimes whenever I use my mouse to scroll on iTerm2 the scrolling does not work, instead printing a lot of garbage characters on the screen.
This happens very inconsistently. Sometimes it happens ...
6
votes
0
answers
4k
views
Why is iTerm2 is super slow on macOS BigSur?
I am super bummed out: My iTerm2 commands that were previously fast before Big Sur now crawl. Worse, when opening a new terminal it can take up to 50 seconds for the shell prompt to return.
What is ...
0
votes
1
answer
262
views
'Make text smaller' actually reduce the size of the window with terminal or iterm2 in mac, instead of the font size
If I am in full screen mode the shortcut cmd+ and cmd- increase or reduce the size of the text, as it should. Otherwise the shortcuts just reduce or increase the size of entire window, they don't ...
1
vote
1
answer
28
views
iTerm terminal emulation is weird
Recently, I switched to iTerm because a lot of people recommends it, but it behaves quite weirdly. It does not automatically enter "alternate screen mode" if less/man/similar commands are ...
0
votes
1
answer
739
views
How to uninstall iTerm form the mac?
How can I uninstall iTerm from my Mac? I searched a lot on the Internet but I didn't find any helpful Informations.
I want to mention too that I installed iTerm without using Homebrew.
0
votes
1
answer
658
views
"Could not resolve host: github.com" error when trying to run "git pull" in iTerm2
I ran into this error when trying to pull the latest contents of a repository in iTerm2. Removing the origin and re-adding it did not resolve the issue. However, restarting iTerm2 completely resolved ...
0
votes
1
answer
2k
views
How to change default shell in iTerm2 via command line?
How to change iTerm2 shell via CLI?
I want to change the user's iTerm2 preferences.
I've taken a snapshot of iTerm2's preferences:
defaults read com.googlecode.iTerm2 > iTerm2.original.defaults
...
0
votes
1
answer
130
views
How to bind Command-b to move back by a word in iTerm/ZSH?
I just installed iTerm and have ZSH because I have Catalina.
I used to have Bash and Catalina instead, and an iTerm installation on a different laptop that I have gradually configured over the years.
...
1
vote
2
answers
661
views
How to configure zsh to clear history on exit?
This used to be the default behavior on iTerm2 before I upgraded to macOS Calalina.
1
vote
1
answer
31
views
Is there any way to enable a backup of the current directory to take place when an rm command is issued?
I know how dangerous rm can be, and I'm unfortunately not a very responsible person at all. I know that I need to learn, but while I'm in the process, I need some help.
Is there any way to create a ...
2
votes
1
answer
115
views
iterm2 different directory for sourcing zshrc
I started playing around with shell scripting and set up zsh via iTerm2 on my MacBook. I set a zsh directory in .config so to organise my .zshrc and .zshenv config files, but when I launch iTerm2 it ...
1
vote
0
answers
58
views
iTerm now showing cursor when pressing Shift + arrow key
As you can see in this picture, iTerm is adding a kind of overlay cursor (plus this paper icon) above the terminal windows when I press Shift + any arrow key. It seems to be a text selection tool or ...
1
vote
1
answer
1k
views
My Bash or zsh or terminal not working anymore
I know this is probably a simple fix.
But I had my terminal set up perfectly, using a bash profile as default. Then i installed iTerm and now nothing works.
I cant even run the ls command when in a ...
2
votes
0
answers
337
views
Git autocomplete not working on macOS Mojave 10.14.5
I've tried everything I've found on the internet but nothing seems to work. Things I've tried:
Instruction in the git book for bash environments
This medium post
Tried with brew install bash-...
0
votes
0
answers
3k
views
Anaconda on machine but conda command not found
I haven't used Anaconda in a while, I typed conda info into iTerm2 to read this error:
zsh: command not found: conda
I have copied the relevant .bashrc file information into the .zshrc file and still ...
1
vote
1
answer
481
views
How to map a keyboard shortcut to CTRL+R in iTerm 2?
I am trying to map the Command + Shift + Z shortcut to what vim uses for redo, CTRL + R:
What is the proper code I should enter in? It seems that \c is not the correct code, but I cannot find it on ...
1
vote
1
answer
32
views
Finish command from history
A couple of years ago I enabled "finish text" command on iTerm2 + ZSH. For example, if I had "git commit" in my command history in a new command window if I typed "gi" "t history" would be viewable ...
16
votes
3
answers
7k
views
Pasting 'required text' into terminal emulator results in '^[[200~required text~'
I have noticed that when pasting into a terminal emulator, both on macOS (using Terminal.app or iTerm2.app) or in Linux (using urxvt) sometimes I get extra characters.
The characters are always the ...
1
vote
0
answers
63
views
Mac Terminal or iTerm: Copy the current command (not including prompt)?
I am using Terminal or iTerm (iTerm2). Let's say I've typed in a command but haven't hit enter yet. Or maybe I used the up arrow to navigate through my command history. How do I copy the current ...
4
votes
1
answer
1k
views
Create SIGINT (Signal Interrupt) Shortcut for iTerm2
How can I create a shortcut to send a signal interrupt in iTerm2?
Ctrl+c is the default, but I would like to have Command+. (dot/period) send a break signal as it currently does in Terminal.
0
votes
1
answer
113
views
Is it possible to use choose-tree mode with iTerm's tmux integration?
I've discovered that iTerm is able to natively integrate with Tmux nicely, even over ssh. However I currently cannot find a way to use the choose-tree mode, which nicely displays all the available ...
1
vote
2
answers
1k
views
How can I move the vim cursor with the mouse wheel in iTerm2?
This currently works as I want it to in the regular Mac Terminal, but not in iTerm2. Currently, using the mouse wheel shows my terminal and moves vim down.
To be clear, I don’t want to scroll the ...
4
votes
2
answers
3k
views
Change tab character width in iTerm2
The tab character in iTerm2 seems to be rendered as 8 spaces by default. Is there any way to change this to, say, 2 or 4? I didn't find anything in the iTerm2 preferences or documentation.
0
votes
1
answer
221
views
how can one put a shadow around an iterm2 window
In iterm2 Build 3.3.2 under defaults, if several windows are open, their
boundaries are difficult to distinguish visually. All windows are uniformly the same color. There is no shading around the ...