Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.