Pseudoterminal

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pseudoterminal

Samba - linux mailing list
My default shell is fish. And my "config.fish" file starts with a
"fish_title" function.

{When using most virtual terminals, it is possible to set the message
displayed in the titlebar of the terminal window. This can be done
automatically in fish by defining the fish_title function.}

https://fishshell.com/docs/current/index.html

It starts by stating the number of the pseudoterminal. Currently that's
saying "Pseudoterminal 1".
{
echo "Pseudoterminal "
        tty | cut -c 10,11
}

A problem arose when I tried to distinguish between pseudoterminal
interfaces tty and pts. If the former were in use, then I wanted the
terminal title line to begin "Terminal "... instead.

But I got into all manner of bother when I tried lines like the following.
{
if tty | cut -c 6-8 'tty' echo "Terminal "
}
--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: Pseudoterminal

Samba - linux mailing list
> A problem arose when I tried to distinguish between pseudoterminal
> interfaces tty and pts. If the former were in use, then I wanted the
> terminal title line to begin "Terminal "... instead.

I solved it thus.

{
        set pseudoterminal (tty | cut -c 6-8)
        if test $pseudoterminal = 'tty'
                echo Terminal
        else
                echo Pseudoterminal
        end
}

When will tty show a "tty", and when a "pts"?
--
www.netspeed.com.au/bryan/

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux