User avatar
TerryC65
Posts: 149
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Cannot open nano in boot shell

Sun Mar 10, 2019 12:20 pm

Earlier this week I downloaded and installed the latest Raspbian image from the Downloads page (2018-11-13-raspbian-stretch-full.img) and installed it onto an SD Card for use in a new project. The target device is a Pi Zero but I used my Pi 3 to perform all the updates before plugging the card into the Zero.

As far as my project is concerned, everything is working fine, but when I try to open nano in the initial boot shell, I get:

Code: Select all

error opening terminal: unknown
If I open a shell and type nano within the desktop, everything works.

What is going on here? I've always used nano on earlier projects and had no issues as far as I can recall.

User avatar
scruss
Posts: 2475
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Cannot open nano in boot shell

Sun Mar 10, 2019 1:26 pm

You get that if there's no pseudo-terminal set. nano needs to know the terminal type and size to make up its screen layout, and without that it'll give up.

I don't recall how you're logging in, but if it's through ssh, you'll need ssh -t.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
TerryC65
Posts: 149
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Cannot open nano in boot shell

Sun Mar 10, 2019 1:27 pm

This is just a standard login with a monitor and keyboard. (I have set the Pi to boot into a shell.)

User avatar
TerryC65
Posts: 149
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Cannot open nano in boot shell

Sun Mar 10, 2019 5:42 pm

My local Linux user group answered this.

I set the TERM variable to 'vt220' in env.

I don't know why it's suddenly stopped working though.

User avatar
scruss
Posts: 2475
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Cannot open nano in boot shell

Sun Mar 10, 2019 8:30 pm

Yeah, I'm trying to find where TERM is set. Over serial, it's the getty service. On the console - no idea. It's supposed to have the value linux for the framebuffer console.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
TerryC65
Posts: 149
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Cannot open nano in boot shell

Sun Mar 10, 2019 9:02 pm

I initially did it as a shell command, eg:

Code: Select all

TERM='vt220'
but that isn't persistent.

Eventually, I added that command to .bashrc, but that clearly isn't the only way.

imaginaryeast
Posts: 14
Joined: Tue Nov 13, 2018 2:43 pm

Re: Cannot open nano in boot shell

Tue May 14, 2019 4:57 pm

This is completely happening to me as well. What do I type into .bashrc in order to make this change persistent? I tried just adding the language to the bottom of the file and it made my system flicker and was unresponsive.

Thanks,

User avatar
TerryC65
Posts: 149
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Cannot open nano in boot shell

Thu May 16, 2019 6:48 am

imaginaryeast wrote:
Tue May 14, 2019 4:57 pm
This is completely happening to me as well. What do I type into .bashrc in order to make this change persistent? I tried just adding the language to the bottom of the file and it made my system flicker and was unresponsive.
How long ago did you download your copy of Raspbian? I've downloaded it several times since I posted this and not had the problem again. (In fact, I'd forgotten all about it.)

AFAICR, I simply added the command to the bottom of .bashrc, which I assume is what you have done.

imaginaryeast
Posts: 14
Joined: Tue Nov 13, 2018 2:43 pm

Re: Cannot open nano in boot shell

Fri May 17, 2019 2:39 pm

A few days ago. I did 3 seperate images. About to do a third of "lite" version of stretch and hopefully it works without your fix.

imaginaryeast
Posts: 14
Joined: Tue Nov 13, 2018 2:43 pm

Re: Cannot open nano in boot shell

Fri May 17, 2019 5:01 pm

The new install I did of stretch lite worked fine. But the 3 installs of the full package with extra stuff had that same issue.

xtal256
Posts: 14
Joined: Sat Aug 26, 2017 8:34 am

Re: Cannot open nano in boot shell

Sat Jun 08, 2019 4:00 am

I've got the same issue with a fresh install of Raspbian.

Adding the TERM env var worked, but as others have pointed out it's not persistent.

I doubt adding it to .bashrc is the best way, as .bashrc itself checks for '$TERM', implying that it should be set elsewhere.

Return to “Troubleshooting”