On Fri, Nov 15, 2024 at 2:09 AM Philip Guenther <[email protected]> wrote:
>
> On Thu, Nov 14, 2024 at 3:56 PM Anders Andersson <[email protected]> wrote:
> > I'm trying to move my screen+irssi (irc client) setup from a linux
> > machine to OpenBSD 7.6 but I found that screen has a slightly
> > different behaviour that I can't debug further. I know I should switch
> > to tmux one of these days, but old habits die hard. I want to see if I
> > can fix this first.
> >
> > The problem is that I don't get any colours in irssi when I start
> > screen in detached mode. Detached mode means something like this:
> >
> > $ screen -d -m irssi
> >
> > This starts irssi in a new screen session in the background, without
> > attaching to it directly. As the manual points out, this is useful in
> > startup scripts, and I normally run this from cron with @reboot.
> >
> > However, screen -d -m causes irssi to draw everything monochrome,
> > while plain screen works:
> >
> > $ screen irssi    <- colours
> >
> > $ screen -d -m irssi
> > $ screen -r        <- no colours
> >
> > On my linux machines I get colours in both modes and I can't seem to
> > find what the difference is.
> >
> > $TERM is "screen" on both instances, and I've tried manually changing
> > it to things like "xterm", "screen-256color" with no effect.
>
> I think you're on the correct line, but maybe there's some other
> environment variable affecting things.
>
> So, run 'env' in both and compare the output for other differences.

Thanks! This showed me that even though TERM is identical in both
places, TERMCAP is not! When I unset TERMCAP inside the "broken"
screen, irssi starts working as expected again.

When I knew what to search for, I found a nearly identical question on
Stack Exchange:
https://unix.stackexchange.com/questions/67450/gnu-screen-strange-termcap-when-using-d-m
with a very detailed answer for FreeBSD but I assume the root cause is
the same on OpenBSD.

The solution I found the least intrusive was to just start irssi like
this:   env -u TERMCAP irssi

// Anders

Reply via email to