Opening up iTerm / Terminal with commands by default. - macos

My current use of iTerm is the following everytime:
- Open up
- cd into my project folder
- open up another tab
- cd into my project folder
- Grunt Watch
- open up another tab
- SSH into live server
This is getting a bit tedious now, is there a simple way to make a one click for all of this to be done? I remember back in the windows days you could create custom command prompt files so it would open up and you could just double click it like an app.
Is there anyway I can do this? I have looked at the profiles and I don't think I can do what I am after with that.
Just need pointing in the right direction.

If you're using iTerm2, there is a feature called Arrangements (see the last entry on the page). With this, you can set iTerm to open a series of profiles (which can be set to run a command at startup, start in a specific directory, run a certain shell, etc.).
It seems that creating one profile for working in a directory, a second for the Grunt Watch, and a third to SSH should be trivial, and once the arrangement is saved, it can be recalled with the press of a hotkey (Cmd⇧R on my install). You can also set this to save split-pane windows if you don't want a separate window for each of these tasks.

Related

Can I have multiple Powershell Consoles in one window?

So, now I have many open apps, often 3-4 powershell consoles. I'm able to order the powershell windows to watch them together (top left, top right, bottom left, bottom right).
So this means that if I switch to another app, when I switch back I have to restore all multiple powershell windows to see them all again.
What I want is, to create only one 'shared window' for many powershell, because when I need one, I need all of them to see.
Is there a way to do this?
Just to add more details about Windows Terminal approach:
Open a Windows Terminal
Type Alt+Shift+= or Alt+Shift+- to open a new Pane in the same tab
Type Shift+Ctrl+W to close the current Pane
If you need more details or modify the settings, go to next page Panes in Windows Terminal
ConEmu has this option.
You can also configure it to open as much consoles as you want when it starts.
ConEmu website
Enjoy!
VSCode can have Multiple Terminals which is the closest to this I've seen, quoted from documentaion:
You can create multiple terminals open to different locations and easily navigate between them. Terminal instances can be added by hitting the plus icon on the top-right of the TERMINAL panel or by triggering the Ctrl+Shift+` command. This creates another entry in the dropdown list that can be used to switch between them.
You can also split the terminal by triggering the Ctrl+\ command or via the right click context menu
Windows now provides the Windows Terminal.
Windows Terminal can split the terminal into panes and can also run different shells (i.e. cmd, powershell, and bash through the wsl)
You can install Windows Terminal directly from the Windows Store.
Create a virtual machine where you can run your PowerShell sessions uninterrupted. The PowerShell windows are always where I placed them when I come back.
It could be an expensive solution depending on your needs, but I have been doing this a long time. It's a robust solution since the only user processes on the VM are my PowerShell sessions.

How to configure ConEmu to start with gitbash and on a specific directory

I just installed the ConEmu terminal, and I am having trouble configuring it to start with gitbash as my terminal instead of the windows CMD, and I would like it to start on ex: /c/Users/Kalin/Drive
I tried to randomly pass values to the settings since they are very hard to understand. I have no idea what {Shell::cmd} means in the "tasks" category (which I guess is the place to change the configs) but I have no idea. The whole thing looks like something from a commercial aircraft and I'm lost :)
You can try the following step-by-step instructions:
Open the settings menu.
Go to Startup -> Tasks in the left pane
Click the + at the bottom of the list of "Predefined tasks (command groups)"
In the big textbox, enter:
c:\path\to\gitbash.exe -new_console:d:/c/Users/Kalin/Drive
Save settings
The key thing to recognise is that this is the minimal config. To begin with, you will ignore all the options. When you want to do the next tweak, then look for it in the manual.
In the latest version, this configuration is more simplified. Just do as follows
Go to {Bash:Git bash} predefined task
In the big text area, keep your cursor to the end of the prepopulated text, so that it is right after -new_console:d: text
Below the big text area, you will see the following options
Add: Tab... | Startup dir... | File Path ... | Active tabs
Just pick your startup directory from Startup dir... option
Restart ConEmu and you will see the session starts with the startup directory you have configured.
NameGoesHere's answer worked for me. I just had to make one modification on the fourth step:
When you set your directory you need to use "new_console:d:c/Users/Kalin/Drive", whithout the bar after "new_console:d:".
Rather the simple way must be to add the path under Task Parameters as
/dir "C:\Dir\subDir....."

can I save my current dir and windows in cmder?

How to save my current setup in Cmder
I use Cmder on windows for all of my deving. I use a separate front and back end for my MEAN applications and also gulp for javascript minification. Also to run mongodb I use the cmder.
My window looks like this once everything is running
Every time I start work on my project I have to open all these windows and run the cd commands to get to their respective folders. I was wondering if there was a way to save the session so that I can have all my windows open automatically in their correct dir?
Use startup settings
You can write startup settings that allow you to execute a series of tasks on startup under
Settings > Startup > Tasks
Here you can define what shell starts and what tasks it should perform, with this you can open new tabs and cd to where you need to work.
A simpler version of this is to just go as far as
Settings > Startup
and find the radio button "Auto save/restore opened tabs", this will at least open up you Cmder where you left off, without the cmd's running.
Hope this helps people who use many windows on startup.

Is it possible to run terminal/command prompt inside Rubymine?

I would work much faster if I could have some kind of command line running inside rubymine, is this possible? When testing I repeatedly have to switch to my terminal window and it gets quite annoying.
I can run rails console and also the sandboxed version side rubymine aswell as my rails server and spork server.
It would be nice to have a command prompt inside rubymine also would speed things up. Infact that would make rubymine 100% perfect for my rails development as it does everything else require.
There is no such feature in IDEA platform based products. You need to run terminal externally. Note that you can create an External Tool to run terminal window in the current file or module directory for convenience.
UPDATE: Terminal (SSH console) was added in PhpStorm/WebStorm 7.0, IDEA 13, RubyMine 6, PyCharm 2.7.3.
I have used CrazyCoder's instructions to do this. Here are the instructions for Windows:
File, Settings
bottom half of menu is titled IDE Settings, look in this list to find External Tools
Click in the only available button (for most), [+]
give your custom thing a name ("terminal"? "command prompt"?)
most of this stuff you just leave blank
click the [...] button next to Program, then simply navigate to Windows/system32/cmd.exe
Lastly, unless you want to have your starting command line (terminal) path as C:\Windows\system32 (CHANGE YOUR PATH), simply click on the [...] next to the "Working Directory" just below, and change your path to Desktop or whatever it is you prefer.
Click OK.
You're done! It's that easy. Now to access this (no restart required), click on Tools, and then under 'XML actions' (for me anyway) you should find your "terminal" or "cmd" or whatever it is you called it. You can test it out with an 'ipconfig' command. You can always go back to the the settings/external-tools place you went to in the first place to edit your settings (like your default path), or to make another custom tool, because this (RubyMine External Tools creator) is obviously a very powerful tool.
If someone is searching this for rubymine in version 7.
Press Alt+f12 for the terminal.
Source : https://www.jetbrains.com/ruby/webhelp/working-with-embedded-local-terminal.html

New OSX User: Opening up a new terminal window in current space(?)

I'm just meddling with OSX after a few years on Linux. There's a lot that I'm liking, but one thing that's slowing me down is that if I run the 'terminal' command via shortcut/spotlight/quicksilver, it whisks me off to any existing terminal in whatever space already has a terminal instance open.
I regularly like to pop up a terminal, run a quick command and then close it again, all the while staying in whatever desktop space I happen to be on.
...So, how do I do that on Mac?
Cheers...
Go to System Preferences -> Exposé & Spaces -> Spaces and check When switching to an application, switch to...
Download this tool called Visor
It lets you quickly get a tabbed drop down terminal using a hotkey like Ctrl-`.
Insanely convenient for working in the shell.
Try this tool: https://github.com/nmadhok/OpenInTerminal
This is a really handy tool for programmers on Mac as it lets you open the folder directly in Terminal. You can select multiple folders to open them in multiple terminal windows. You can also select files to open the parent directory in Terminal. This application works with Finder as well as without Finder which is a plus!

Resources