Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional note on saving file in Nano #610

Closed
kfayesawyer opened this issue Apr 16, 2019 · 2 comments
Closed

Additional note on saving file in Nano #610

kfayesawyer opened this issue Apr 16, 2019 · 2 comments

Comments

@kfayesawyer
Copy link

@kfayesawyer kfayesawyer commented Apr 16, 2019

In going through 4 - Tracking Changes, I hit a snag after typing my first line in Nano. The lesson says:

"Type the text below into the mars.txt file:

Cold and dry, but everything is my favorite color
mars.txt now contains a single line, which we can see by running:
$ ls
mars.txt
$ cat mars.txt
Cold and dry, but everything is my favorite color"

It's not explicit that you have to save and exit the file in order to run the next command. I'm happy to submit a pull request to fix it, if it's not too pedantic!

@tkphd
Copy link
Contributor

@tkphd tkphd commented Apr 16, 2019

Using a command-line text editor, like Nano, it's impossible to get the prompt $ that allows you to type the next command, unless you first exit: the text editor occupies the entire terminal. However, updating the lesson to reflect that you have to save the file before you can run the next command might be helpful to those who are using a text editor that is not in the terminal, perhaps as a GUI or separate terminal application.

When teaching this lesson, I'm usually slow and careful to say, "I've opened nano to edit mars.txt... Now I'm typing in some details... then pressing -- look along the bottom, it's Ctrl+X to exit, then Y to save... Press enter to keep the file name... Now we're back to the terminal."

@kekoziar
Copy link
Contributor

@kekoziar kekoziar commented Jul 3, 2021

Hello, @kfayesawyer and thank you for your comment. At the beginning of episode 4, there is a reference to a section on working with text editors. Those who are completing this in the workshop sequence (Shell then Git) won't necessarily need this, but those who are reading through on their own, or teaching it as a stand-alone lesson will have a link to the content covered in the shell lesson.

For a refresher on text editors, check out “Which Editor?” in The Unix Shell lesson.

This linked/referenced section explicitly lists how to save files in nano. I agree with @tkphd in how I teach the lesson. I am constantly stating "ctrl-O save, then ctrl-X to exit" since it slows me down and reinforces the Nano commands. Nano will also provide a prompt if there are changes to the file that haven't been written out.

Feel free to add a generic comment that learners need to save their files in order to progress.

The cat mars.txt is the double-check to make sure the file was properly saved.

@kekoziar kekoziar closed this Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants