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

Ruby

Keyboard Shortcut for Moving Focus to the Console

What is the keyboard shortcut for moving between the file work area and the console and back again?

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Susan,

I'm not aware of any keyboard short-cut that does that, sorry.

Jason :)

Hey Susan,

Not sure if there is a shortcut in workspaces (sounds like 'no' given Jason's response), but if you aren't using workspaces to write and run your code there are fast ways to switch between the 'console' and where you actually write your code.

For example for Mac, I use a tool called Atom (it's free, quick google online) to write all my code. You can run the code directly in Atom by pressing command-i ---- or if you'd rather run in 'Terminal' on Mac (basically your computer's 'console') you can save the atom file and then run it using terminal. If both atom and terminal are open, switching between the two is as easy as command-tab :) ---- Although keep in mind in Terminal you will have to navigate to the folder where your code is kept before you can run it the same way you would in the console. So let's say I save my atom file as Yayfun.rb and put it in a new 'code' file in my 'Documents' folder, I would need to open 'Terminal' on my mac, type in "cd documents/code" to move to the folder (cd stands for change directories) and then I would type in my "ruby Yayfun.rb" command.

Atom --- command-i is what I mainly use to run code though (fast and easy! and I like having all my practice code saved on my computer in one folder versus in workspaces in treehouse).

Hope that was helpful! S