Making changes to UI permanent in iTerm (iTerm2) - macos

I am new to the MacOS, and I have started using iTerm, and I want to make the changes to my UI permanent, but I am unable to do so.
When I "right-click" in the iTerm window and go to Edit Session... > Preferences>Text>Cursor>Vertical Bar, my current instance of iTerm does what I want it to.
However, when I shut it down and start another window some time later, it reverts back to its old settings. How do I make these settings permanent so I don't have to keep repeating the above process?
Also, I have switched from using zsh to using bash, however, I still see this when I open an instance of terminal:
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Isn't my default terminal now bash, not zsh?

Instead of right-clicking and entering "Edit Session...", you can make permanent changes from the navigation bar on the top of your screen once you open the iTerm.
iTerm2 > Preferences > Profiles > Text > Cursor > Vertical Bar.

When the above didn't work for me, I found (from iTerm2 menu bar):
Preferences > General > Preferences
Where I had set Save Changes to Manually. Right next to that setting is the Save Now button.

Related

How can I use iterm as default terminal on macOS?

I want to make iTerm2 as my default terminal on macOS,
I open iTerm2 and hit to make iTerm default Term
But it's not working!
And I go to default terminal preferences
But after open it I see this
(Open iTerm Build version 3.3.7)
Menu: iTerm2 > Make iTerm2 Default Term
It sounds like you need to rebuild your macOS' LaunchServices.
To do this, download OnyX and choose the version based on your current macOS version.
The option that you need is in the red box, and I'd suggest that you UNCHECK anything that you don't need or don't know; otherwise, you might end up with deleting data that you might need:
After that, you can try again with the built-in Make iTerm2 Default Term option in iTerm2 (if this option is greyed out for you, click option + the iTerm menu button to re-enable it again).
There are ways to do this through the command line without downloading third-party apps, but I trust OnyX enough to hand it the job.
However, if you decide to do it from the command line, make sure you type the command that corresponds to your current macOS version. More on that here.
Hope this helps :)
Use this location instead:
/Applications/iTerm.app/Contents/MacOS/iTerm2
but note that it will not solve your issue completely. Termianal will start anyway, but this time, it will run iTerm2 - as you instructed it to do.
One thing you can do is find the file that opens a terminal (in my case it was metro opening in a React Native app). Find the file in your finder, right click on it, choose get info, then expand the Open With tab. There you should find a dropdown menu on what to open those kind of files with. The default is terminal, but choose iTerm2 and click on change all.
For example, in my situation I had to find launchPackager.command file under node_modules/react-native/scripts/. Do the above with that file and it will make iTerm your default terminal after clicking change all.
From where do you want to open the terminal? I was facing the same problem as you when I wanted to open the external terminal from Visual Studio Code.
I solved it by going to Code > Preferences > Settings. Look for terminal in the search bar and setting /Applications/iTerm.app in Terminal > External for your operating system.

MobaXterm - reset terminal screen

I need to Reset my MobaXterm screen after some time working, however 'clear' and 'reset' commands wont work as if I was on a linux server.
Anyone have some tip?
Right click MobaXterm screen > Click Clear Scrollback
Note: Your MobaXterm may be set to paste on Right-Click; in this case use Ctrl+Right-Click.
When 'Paste using right-click' is checked, you still can use Ctrl/Shift + Right Click to pop up the contextual menu.
To reset your MobaXterm screen, use:
Right click on selected MobaXterm screen > Clear Scrollback (as describe above)
Or, if the prompt is available, launch the command 'cls'
Or, in all cases (prompt available or not), press CTRL+L keyboard keys
Mobaterm seems to like playing around with the putty configuration - so I found that right clicking on the window -> change terminal settings
-> features -> enable everything.
-> window -> disable push erased text into scrollback
the usual clear control commands
function clear() {
printf '\033[2J' # clear
printf '\033[H' # home
}
will now clear the screen and clear the scrollback
Right click on the terminal window in MobaXterm.
In the popup menu, click Change terminal settings...
In the tree, click Terminal > Features
Uncheck Disable remote-controlled clearing of scrollback
In the tree, click Window
Uncheck Reset scrollback on display activity
Click the Apply button
You can now type clear and have the window clear and remove the scrollback.

How to preserve iTerm folder location between sessions?

I'm using iTerm 2, and each time I exit and launch it again it doesn't save the folder location I was working on.
This is really annoying to have to retype each time the previous location I was working on, event more when there were multiple tabs opened...
Is there a way so that iTerm automatically save the folder path for each tab when I exit ?
iTerm 2.9.x (currently beta) and above support restoring sessions like the default Terminal.app in OS-X.
http://iterm2.com/downloads.html
https://gitlab.com/gnachman/iterm2/issues/3717#note_1733467
On macOS, make sure to uncheck "Close windows when quitting app" in the System Preferences/General tab (note this is in the System Preferences, not in the iTerm2 preferences).
Also set the following iTerm2 settings in the iTerm2 preferences:
General tab: select Use System Window Restoration Setting
General tab: uncheck Open profiles Window
General tab: uncheck Confirm closing multiple sessions
General tab: Confirm "Quit iTerm2 (⌘Q)" command
Advanced tab: Restore Window contents at startup = Yes

In iTerm2 what is the difference between the "default profile" vs. the "current profile"?

When I want to start a new tab in iTerm, it gives me a choice of the default profile vs. the current profile. My understanding is that every time a terminal window is opened settings are read from my /etc/bashrc file -- so I guess that's the default. Why might I want to open a new tab using my current profile? Wouldn't it just be the same?
Thanks.
iTerm2 profiles are different than bash profiles. iTerm2 profiles are set up in prefs->profiles and define things like colors and keyboard shortcuts, while your bashrc is specific to your shell.

How to mouse scroll with Git Bash?

Using Git Bash or MinGW Shell, if I put in a command with much output,
for example env, I cannot mouse scroll. A regular old Command Prompt (cmd.exe) window will do this however.
Enable Quick Edit mode
Open Properties: AltSpace, then P (for properties)
Under Options tab > Edit Options > Check Quick Edit > Hit OK
Now you will be able to scroll with mouse.
In the latest version of the git bash you don't have any property such as Quick Edit but then too your scroll might not work as it was my case..
press alt + space then click options and go to window then
Simply change your scrollbar location from right to left or vice versa then it will work, at least worked for me.

Resources