How do I get back to nano after hitting Ctrl-Z if I have no shell prompt (in Matlab session)

Solution 1:

If it's the only backgrounded process entering % followed by Return should return you to nano.

That said, fg should always work. Even when you have more than one job, it should bounce you back to the newest one.

Solution 2:

List your jobs

jobs

Bring a job to the foreground

fg 1

change the "1" to the job number corresponding to nano.

See also https://unix.stackexchange.com/questions/30228/basic-job-control-stop-a-job-add-a-job-onto-the-stack-and-fg