Back to Blog
Iterm2 windows5/16/2023 ![]() ![]() You’ll notice that, in this script, I use `session.async_split_pane(vertical=true)` to split my current window in two. Then, I send the commands I want for that window like this: ![]() I prefer to start my script in the current window I’m in, so I start with this: You can script iTerm2 to open new windows and tabs for you. If you wish to do something like this, when creating a script choose “Long-running Daemon” when prompted. iTerm2 allows long-running process.įor my purposes I need to run a command in a terminal window like docker compose-up or make dev and then leave that tab open and running so I can monitor and also run other commands in different tabs and windows. After some experimentation, here are the two most useful features I found. After doing some research, I found that iTerm2 has a Python API that you can use to write some really useful scripts! Here is the documentation I used. I talked to my manager, Joe Chrysler, and he told me I should look into scripting my iTerm2 terminal. I thought maybe I could do something similar so I could just run a single script to get everything set up and running. After doing this arduous process one too many times, I figured there must be a better way.Īt this point, I’d gotten a little experience with bash scripts that we use in our project. I also have to arrange my iTerm2 windows and tabs in a way that makes sense to me each time. I find it hard to remember all the different environment variables I need to set and the different terminal commands required for each app. Getting everything set up correctly can consume a lot of time and lead to frustration. Every once in a while, it is necessary to test something end-to-end with all five apps running locally and pointed at each other. I work on a software project where we currently have five different repositories. ![]()
0 Comments
Read More
Leave a Reply. |