All Questions
136
questions
0
votes
1
answer
81
views
How to disable row highlighting on iterm and oh-my-zsh?
I just setup the new Macbook today and start to have the weird highlighting with the blue frame on the row when i use my mouse to select a particular row on the terminal. The other row will be faded a ...
0
votes
0
answers
20
views
iTerm2 - run a command in every new pane
I'm using iTerm2 and oh-my-zsh.
Whenever I start a session — a new iTerm2 window — it reads my .zshrc file and runs a few commands — e.g. getting the right Node version from .nvmrc. But when I open a ...
0
votes
0
answers
56
views
column listing misaligned after pane resize in iterm2
So, I use iterm2 (on mac os 11), with multiple panes in one window (e.g. horizontal and vertical splits). Sometimes after resizing either the whole iterm2 window, or just one of the panes within the ...
1
vote
0
answers
145
views
Tmux sending wrong keycodes for "ctrl + arrowkey" and "ctrl + shift + arrowkey"
The problem
I upgraded to MacOS 13.5 today and immediately noticed this issue. Inside of tmux (running in iterm2) when I perform ctrl + arrow-key or ctrl + shift + arrow-key the wrong keycodes are ...
0
votes
0
answers
65
views
How can I get iTerm2 to colour-code remote tmux sessions?
Currently I have a script called et.sh, which ssh's into a server, and integrates with iTerm2's native tmux integration to display the tmux session in native windows;
until ssh $1 -t "tmux -CC a -...
0
votes
1
answer
440
views
How can I prevent iTerm2 from printing environment information on startup?
I recently started using iTerm2 + Oh My Zsh to see what the hype was all about. While it's cool, I had some issues getting it to work properly. Specifically, it wasn't recognizing standard commands ...
0
votes
1
answer
65
views
Streaming outputs to another window without running the same commands again on iterm2
First of all, I think every command running consumes some resources.
So if I'd like to have another window displaying the same output of the same commands being run on another session without running ...
0
votes
1
answer
2k
views
how to change the main color of iterm2
I was trying to change the main color of iterm2 using the foreground color, but I discovered that it only affects some text but not all text:
same goes if I launch mysql on command line, it takes the ...
0
votes
1
answer
83
views
How do I send the 'setMark' escape code in Windows Terminal or iTerm2?
Windows Terminal now supports setMark which originally came from iTerm2.
How do I add a mark (non interactively, ie so I can use this in my $PS1)? The docs have a screenshot of the relevant text ...
3
votes
1
answer
3k
views
How do I get mouse scroll in less to work in iTerm2 like it does in Terminal?
On macOS Ventura, on a MacBook Air, with a fresh user account and default settings, in Terminal.app, I can run man less and then use my trackpad to scroll down the manpage -- equivalent to hitting j ...
2
votes
4
answers
2k
views
How to open a new vscode tab but not a new vscode window when using "code ." in terminal?
As the title says, I input "code ." in my iterm2 terminal to open a folder in my vscode, and want it be opened in my current vscode window(in other words, in a new tab), but not create a new ...
2
votes
1
answer
1k
views
Iterm2 fully clear scrollback within ssh
I am sshing into a server from my mac on Iterm2. The commands that I run on the server produce lengthy outputs that I want to clear the scrollback before running each. So, I decided to use clear ...
0
votes
1
answer
554
views
Why can't I scroll or use ctrl-a/ctrl-e when using screen?
I use iTerm2 and I realized that when I'm using screen: ssh -t [username]@[domain].edu 'screen -DR'
I noticed the following vagaries:
I can't use my mouse to scroll up and down in an iTerm2 window
I ...
0
votes
2
answers
127
views
How to write Iterm2 Scripts with single quotation marks
I'm trying to write a script in Iterm2
This should set a title on the current Tab
await session.async_send_text('export PROMPT_COMMAND='echo -ne "\033]0;TAB TITLE\007"'\n')
But I'm getting ...
1
vote
0
answers
105
views
Long boot time of a new window in iterm2 on Macbook Pro M1 Pro
I have been using iterm for a few years. I have recently switched to a new macbook M1 Pro and had to reinstall everything. I use zsh with powerlevek10k however when I open a new terminal in iterm it ...
2
votes
1
answer
2k
views
How to re-map Iterm2 Ctrl+L and Ctrl+D to Cmd+L and Cmd+D
Migrating from Ubuntu to Mac, my muscle memory is to use Ctrl+L and Ctrl+D to clear screen and exit shell for bash
Using iTerm2, I repeatedly press Cmd+L and Cmd+D which either doesn't have any effect ...
1
vote
0
answers
361
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 ...
32
votes
2
answers
24k
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-...
0
votes
0
answers
678
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 ...
2
votes
2
answers
6k
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 ...
1
vote
1
answer
118
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
7k
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.
1
vote
1
answer
5k
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
...
1
vote
1
answer
187
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
540
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
165
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
3k
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 ...
1
vote
1
answer
1k
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 ...
2
votes
0
answers
148
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 ...
2
votes
2
answers
4k
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 ...
0
votes
1
answer
469
views
Weird terminal bug(?) - have to control+c after every command
I'm having a weird issue with both terminal and iterm, where when I cd into a specific directory (and every subfolder), I have to control+c to 'exit' after every command that I run, and only then can ...
1
vote
0
answers
3k
views
How do I turn the dollar sign onto a new line in terminal?
In a terminal window I want to be able to enter commands on the next line
Instead of:
Something-MacBook-Pro-2:~ someone$ <command>
I want:
Something-MacBook-Pro-2:~ someone
$ <command>...
2
votes
1
answer
3k
views
How can I change the line height in iTerm2?
I've tried looking through iTerm2's text preferences, but I don't see a way to change line height.
How can I add more space between lines in iTerm2 for Mac?
1
vote
1
answer
158
views
VIM startup symbols in status
I am trying to move to VIM as my main text editor, already spent a lot of time setting everything and reading about VIM.
Now everything is pretty much ok, except one thing that bothers me all the ...
2
votes
0
answers
715
views
Configure key to turn off mouse reporting in iTerm2
Currently, mouse reporting is disabled using the option key. Is there a way to configure this to shift key i.e. I hold down shift to select text instead of option. I don't want to permanently remap ...
0
votes
1
answer
206
views
zsh / oh my zsh rendering and running a slightly mistaken command
I've searched for this, but I haven't found a match. Even though I think it has to do with completion errors (of which there a few posts), my Zsh has a different and undesired outcome.
When I go 'up' ...
24
votes
2
answers
13k
views
Enter key prints ^M in certain situations in iTerm
I am using iTerm2 on a Macbook Pro running MacOS Mojave.
In certain situations, such as when doing a git add -p, pressing return ends up printing ^M instead of performing the action.
Stage this hunk ...
1
vote
1
answer
391
views
Homebrew + PHP + iTerm
I just recently switched over to iTerm instead of the default Mac terminal. Everything works well except php. For some reason, even though both iTerm and Terminal are using the same zsh shell, iTerm ...
5
votes
2
answers
5k
views
Can I have the terminal prompt at the vertical middle of a window?
I just realized that I hunch over a lot when using the terminal since the prompt is always at the bottom of the terminal window, which is vertically maximized.
I would like the prompt to be at the ...
1
vote
1
answer
1k
views
Everytime I open iTerm my .zshrc file gets a new vscode Path line
# iTerm
# CMD + D to split screen (left right)
# CMD + D + Shift to split screen (up down)
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/...
3
votes
1
answer
958
views
Make cmd-click on a file name in iTerm add that filename to the command
By default, iTerm lets you cmd-click filenames and urls to open them with the system's default app. I want to be able to change that so it adds the filename to the command I'm currently typing.
This ...
1
vote
0
answers
150
views
Please make my terminal behave like a word processor because I'm old and jaded
How do I make the terminal input behave like a multi-line word processor that lets me select text, delete some text (no hex codes), move around, then only really send it over the wire when I press ...
21
votes
5
answers
17k
views
Is it possible to use vim key bindings in iterm2?
I want to use w for next word and b for previous word. If I could do more than that I would be even happier.
I use bash if that matters.
6
votes
2
answers
4k
views
Why does iTerm paste when I left click in the terminal
Every so often I come back to a iTerm2 (v3.1.6) terminal window and for whatever reason when I left click anywhere in the window it will paste whatever is on my clipboard. This has happened many times ...
0
votes
1
answer
55
views
How can I change the page depth when using screen on iterm2 to connect to a router?
Let's say I'm connecting to a router with 'screen' through a terminal (iterm2) and I want to view a log or a configuration. It will only display 1 page at a time and I have to press Enter or Space to ...
0
votes
1
answer
5k
views
How to update Mac iTerm2 terminal prompt
I am using Mac 10.13.2 High Sierra. I made the following .bash_profile file to see the file path along with the prompt and if it has any Git repository it shows the Git status as well.
All is working ...
1
vote
0
answers
154
views
iterm itermplot tmux scroll makes plots disappear
I have a tmux session in my iTerm2 window with a single pane. When I plot something using ipython (with itermplot) it appears as expected. As soon as I switch to scrolling mode ( [ ), the plot ...
0
votes
1
answer
1k
views
iTerm2 shares the same instance across all macOS workspaces
Suddenly after a computer restart, my iTerm behaves differently, as the same iTerm2 instance is shard across all macOS workspaces.
If I open a new tab or open a new windows of iTerm2, these will ...
2
votes
1
answer
224
views
How to `git show` a commit by Cmd+clicking a Git commit hash in iTerm2?
I am using iTerm2 with oh-my-zsh. git log --oneline shows me the git tree:
0b99548e commit A
eb980d4c commit B
e7e5e043 commit C
In order to view a commit, I need to do the following steps:
double ...
0
votes
1
answer
1k
views
iTerm2 doesn't recognize Ctrl-Left and Ctrl-Right
TLDR; I couldn't get the Micro editor to recognize Ctrl-Left and Ctrl-Right key combinations. I thought I maybe have to add escape sequences to iTerm2 (screenshot). The Keyboard Shortcut input field (...