Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $_tty is gone after system upgrade
On Sun, Sep 25, 2022 at 5:33 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> I'm upgrading my system from Debian 9 to Debian 11 and my zsh is now
> whatever Debian installed (vs. old system where I was running Roman's
> pre-build). Prompt is:
>
> PS1=$'\n$_tty $_yel%d $_mag$cc$_nrm $ '
>
> ... which returned just the number of the current terminal on the old
> system but now
>
> $ echo $_tty
>
> ... returns nothing.
I don't recall any version of zsh setting _tty. Debian 9 doesn't set it either.
% docker run -e TERM --rm -it debian:stretch bash -c '
apt-get update && apt-get install -y zsh && zsh -c "typeset -p TTY _tty"'
[...]
zsh:typeset:1: no such variable: _tty
typeset TTY=/dev/pts/0
If you were using https://github.com/romkatv/zsh-bin, that would be
zsh 5.8. It doesn't set _tty.
In any case, it seems better to use ${TTY:t} given that this parameter
is (and has been for a long time) documented and working as intended.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author