When we Run the program the first line to the screen asks for our first name. We can type immediately to the screen (as indicated by the blinking cursor which means waiting for input from the keyboard). If you cannot, then click right beside the question mark and the cursor should start to blink.
Think of the window as having multiple panes, and each one with its own virtual world (in programming we call that a namespace). When we click the Run button, we engage the terminal which now becomes the active pane. The terminal is running our code, imperatively, and in the order in which we wrote it.
Sometimes you will run across the term ‘console’, which is essentially the same thing so the two terms are synonymous. console <=> terminal behave in much the same way. In my mind I separate the two terms thus:
A console has a language that it runs commands in, these commands are interpreted for the terminal which runs commands IT is expecting to see, in the language of the mainframe. I know that’s splitting hairs, and really has no importance. It’s just my view of it. A console operates within a confined environment; a terminal operates in the same environment as the computer it is engaged with.
What happens when we press Run?
The CC program (handler) that intercepts our click of that button passes our data (the program code in file form) to the bash shell with ruby as the prefix followed by the file name.
The shell is the terminal that communicates directly with the computer (OS). We’ve just told it what kind of namespace to initialize and what script to run in it.
We didn’t do that directly, but the handler did. We click, the handler handles, and this is where we arrive… In the shell, or bash namespace with our program running and awaiting keyboard input.