OpenWrt Forum Archive

Topic: Terminal Type and copy/paste

The content of this topic has been archived on 15 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Quick question on terminal type (at least I think that's the problem)...

When I ssh into my kamikaze router and copy some text in a config file, it inserts additional spaces (or maybe tabs) when I paste.  Maybe an example is the best way to explain.

I copy this

config mount
    option target    /home
    option device    /dev/sda1
    option fstype    ext3
    option options    rw,sync
    option enabled    0

config swap
    option device    /dev/sda2
    option enabled    0

But when I paste it into another file on the router, I get this

 
 config mount          
        option target   /home
                option device   /dev/sda1
                        option fstype   ext3
                                option options  rw,sync
                                        option enabled  0                 
                                                                          
                                        config swap                       
                                                option device   /dev/sda2 
                                                        option enabled  0

My terminal was being detected as xterm-color, but I tried vt100 and vt102 with the same results.  What might be the problem here?

-parker

No replies here, but ciscostu pointed out that I was bumping into the autoindent feature of vi.

It can be turned off with the vi command ':set noautoindent'

I turned it off permanently in the .profile file

# cat /root/.profile 
EXINIT="set noai" ; export EXINIT

Maybe this will help someone.

The discussion might have continued from here.