Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Unset special parameters
- X-seq: zsh-workers 32374
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Unset special parameters
- Date: Mon, 10 Feb 2014 17:08:54 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organisation: 63797068657270756e6b
Hi list,
Since commit f3e7cfe47c32a23, some special parameters are initialised to
be unset. Among them PS1 and RPS1. Which means that prompt-themes need
to mark these parameters as global, because otherwise shells running
with ‘warn_create_global’ set will complain.
When I was trying to do that in my own theme, I was first trying this
(quite simplified):
#+BEGIN_SRC shell-script
prompt_ft_precmd () {
# ...
typeset -g RPS1
RPS1='foo'
# ...
}
#+END_SRC
...which still triggers the warning. Only when I assign a value to RPS1
in the typeset call, the warning goes away:
#+BEGIN_SRC shell-script
prompt_ft_precmd () {
# ...
typeset -g RPS1='foo'
# ...
}
#+END_SRC
Is this a bug? Because, if I do this with a non-special parameter, it
works the way I'd expect it to:
[snip]
zsh% foo () {
typeset -g BAR
BAR=thingy
}
zsh% foo
zsh% echo $BAR
thingy
[snap]
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author