1

Could someone please explain step-by-step how the following build script works?

{
"cmd": ["gnome-terminal -e 'bash -c \"python3 -i -u $file;bash\"'"],
"shell": true
}

I know what -i does (keeps interpreter open), and the final bash keep sthe terminal open, but the rest is inscrutable to me. In particular what do -e, -c and -u do, are they called "flags" and where do I learn more about them? Which parts are specific to Sublime and which are to do with the OS?

Robin Andrews
  • 3,514
  • 11
  • 43
  • 111

1 Answers1

1
"gnome-terminal # use this terminal to run the next commands
  -e # execute the following command
   '
     bash -c # read commands from the following string 
       \"
          python3 
            -i # looks like interactive mode (sorry not a python dev)
            -u # force stdin, stdout and stderr to be totally unbuffered
            $file; # tipically this would be a python script, so you 
                   # would end up being able to inspect the environment,
                   # calling functions, seeing their otputs, etc 
          bash # open a new shell
       \"
   '
"

I think the only part that could be part of Sublime is $file but that depends, with a bit more context on that code I might be able to give a better answer.

Community
  • 1
  • 1
Alberto Zaccagni
  • 30,779
  • 11
  • 72
  • 106