Error opening nano

Whenever i get a new Teltonika router,
I install nano to make using ssh easier.
(vi is too un-transparent for me to use)

The method is to first update the openwrt repos:
opkg -e /etc/opkg/openwrt/distfeeds.conf update

Then Install from this repo:
opkg -e /etc/opkg/openwrt/distfeeds.conf install nano

However I recently did a System Reset on my RutX11
which removed Nano, so I re-installed it.

But now, when I try to open Nano I get
Error opening terminal: xterm-256color

How do I fix this?

Hello,

I’ve reached out to our R&D team so they can take a closer look into what might be missing and cause this. I’ll make sure to keep you updated as soon as there’s an update from their side.

Thank you for your patience and collaboration on this.

Best regards,

Hello @alienheartbeat,

Could you try running

export TERMINFO=/usr/local/usr/share/terminfo

before starting Nano to see if that helps?

Let me know the outcome here.

Best regards,

Thanks Martynas, works perfectly.

So I created a short script: nanomc to do this and call nano.

export TERMINFO=/usr/local/usr/share/terminfo
nano

As you know the export only lasts for a session,
and also to run this script from any other dir I have to enter the full path.

Rather than create a .profile with a path line,
which could possibly cause problems for RutOS,
to make life easier, I can instead create an alias in /home/root/.ashrc.

I note that both /home/root and /home/admin are empty
and /home is a link to usr/local/home.

Will it cause any problems if i create a .ashrc file in
/home/root and /home/admin
provided of course I give the entries very unique names?

Hello @alienheartbeat,

Just to clarify, on Unix and Unix-like systems, the /usr/local subdirectory is fully supported when searching default directories for libraries, terminfo, and similar resources. However, placing a usr subdirectory inside /usr/local (as in /usr/local/usr/share) isn’t standard practice and isn’t included in default search paths, which is why it’s failing to locate your terminfo data there.

If the terminfo data were installed in /usr/local/share/terminfo instead, it would work as expected without needing to manually export the TERMINFO variable.

As for your idea, yes, you can either move the terminfo directory to /usr/local/share, or continue exporting the TERMINFO variable. This can be done globally in /etc/profile (for all users) or in the user-specific $HOME/.profile — so adding it to /home/root/.profile and /home/admin/.profile is perfectly fine and shouldn’t cause issues.

Best regards,

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.