Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Using Sass with command prompt closed

I have Windows. Anytime I'm using Sass I have to have command prompt open, as soon as I close it, scss stops updating to css. Is there a way to tell Sass to watch the file and close the command prompt and just have it run in the background? Thanks.

2 Answers

James Barnett
James Barnett
39,199 Points

That's how the terminal (on OS X / Linux) and the command prompt (on Windows) is supposed to work, if you ever want to post a process running in a terminal you just exit the terminal. If you put a process into the background, it will survive the exiting of the terminal.


The quick & dirty way to do this on Windows is to use the start command.

start /b sass --watch styles.scss:styles.css

If you run a command with start /b and you want to restart that process at some point then you have to kill it by hand rather than just closing the terminal window.

To kill process that includes name sass you could use"

wmic process where (name like "%sass%") delete

You could also get an add-on for your text editor that will auto-compile your Sass.


You can also use an app both Scout & Prepros are popular choices

Chris Dziewa
Chris Dziewa
17,781 Points

Here is the program Scout for setting up a Sass project and letting it take care of the rest. This is the program recommended by Hampton in the Sass videos. I haven't personally used it but I don't mind the terminal.