To get started, make sure iTerm is open, then select from the menu: Scripts -> Manage -> New Python Script as shown below: This post will walk you through how to achieve this automation using iTerm and Python. If this helped you improve your iTerm2 workflow, consider following me on Twitter.Do you find yourself opening many iTerm tabs every day to do the same daily routine such as opening editors, running a build, starting up various services etc? If yes, good news, this tedious daily startup routine can be automated, saving you precious minutes each day. The creator Nachman is responsive on Twitter for iTerm2 questions. If this is the case, after you've saved your arrangement with ⌘ Shift S, you must restart iTerm2. You can only test it by re-opening a new arrangement with the keyboard shortcut you set up.Īfter saving an arrangement, it might not show up in the menu item dropdown when creating a new keyboard shortcut. After modifying your shell commands, repeat the "Edit Session" steps including hitting "Change Profile." Then save your arrangement again and overwrite the old one with the same name. The profile doesn't live update, it somehow caches an old version of your shell commands. If your startup commands don't work as expected then you have to modify your session profile commands, then you have to re-assign the profile to the shell. Hopefully everything worked fine and you have a shortcut you can trigger to set up a custom arrangement! Troubleshooting Close all windows again and test your arrangement by triggering your keyboard shortcut!.Open the new "Menu Item" dropdown and scroll down to the "Window" section near the bottom, find the "Restore Window Arrangement" subsection, and select your profile. I prefer something like ⌘ Shift such as ⌘ Shift W to open my "Work" window arrangement.įor "Action", open the dropdown and scroll all the way to the bottom to "Select Menu Item". Highlight "keyboard shortcut" and press the keys you want to open this workspace. Open the preferences again with ⌘, (Command comma). Press ⌘ Shift S (Command-Shift-s) and then name your new arrangment.Īssign a keyboard shortcut to open your arrangement. You won't know if it worked until step 7. ![]() Warning 2: Setting the session will not run the commands you specified. ![]() Warning 1: Hitting "Change Profile" doesn't give you any feedback that it worked. Save by hitting "Change Profile"Īfter you click "Change Profile" you must close the preferences window. iTerm2 doesn't use profile names in the tabs, because why would it?! iTerm2 profile selection modal: 1. You can also use this opportunity to give it a name, which will show up in the tab title. Right click on each shell and choose "Edit Session"Ĭhoose your profile corresponding to this shell.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |