0

I am making a shell script that starts the frontend and backend development servers for my node app. This means starting one server, opening a new tab, and starting the other.

The problem with my current script is that when it starts one server, the script seems to exit.

On its own, the command to open a new tab in the VS Code terminal, using osascript works.

Here is my current implementation of the script:

#!/bin/bash
...
cd $backend_dir && npm run dev
osascript -e 'tell application "System Events" to keystroke "`" using {control down, shift down}' # on its own this opens a new terminal tab
cd $frontend_dir && npm start

Is there a way to accomplish what I want?

Brian Barry
  • 439
  • 2
  • 17
  • You may be able to use nohup. Something like: `cd $backend_dir ; nohup npm run dev &` and then `cd $frontend_dir ; nohup npm start &` – j_b Oct 28 '22 at 19:27
  • I'd rather have the output in the terminal and not in a `.out` file though... – Brian Barry Nov 15 '22 at 20:18

0 Answers0