[Bug 286429] vi mode in /bin/sh not leaving insert mode until set -o is run

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 29 Apr 2025 00:01:57 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286429

            Bug ID: 286429
           Summary: vi mode in /bin/sh not leaving insert mode until set
                    -o is run
           Product: Base System
           Version: 14.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: mason@blisses.org

I'm encountering a very strange issue. FreeBSD 14.2 jail on a 14.2 host, 
created by untarring a 14.2-RELEASE base tarball.

When I ssh in, I can type and enter commands, but I cannot ESC to get
command mode until I run "set -o". "stty sane" doesn't matter. I can go
into nvi, edit normally, and exit out, and the issue persists until I run
"set -o". Makes it feel like there's a race of some sort.

I don't have more detail as yet. I'll try to reproduce this on fresh 
systems.

The environment is pretty vanilla, except that .shrc (from 
/usr/share/skel/dot.shrc) has the "set -o vi" line uncommented.

This is an awful hack, but I seem to be able to get around the issue for 
now by saying "set -o > /dev/null" at the end of my .shrc.

-- 
You are receiving this mail because:
You are the assignee for the bug.