From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: "Eric Cook" <llua@gmx.com>, zsh-workers@zsh.org
Subject: Re: zsh: corrupt history file
Date: Thu, 30 Jul 2020 04:30:03 +0000 [thread overview]
Message-ID: <f9d21359-ba6d-4aea-a264-4d9b87ad4c63@www.fastmail.com> (raw)
In-Reply-To: <1e250159-b06f-ad39-0cef-e27c5fefa89a@gmx.com>
Eric Cook wrote on Thu, 30 Jul 2020 03:56 +00:00:
> On 7/29/20 7:07 PM, Daniel Shahaf wrote:
> > I guess you mean adding such warnings to zshparam(1)? In which case,
> > perhaps adding them to bin_typeset() would be more effective? As in:
> >
> > % export HISTORY=foo
> > zsh:1: warning: $HISTORY should not be exported; use 'typeset HISTORY=foo' instead
> >
> > (and if someone actually needs to export $HISTORY for whatever reason,
> > we can make -h suppress the warning)
>
> That is indeed what i meant, but your solution has two problems in the
> example of PS1. if it is in the environment when zsh starts and the
> user doesn't set it, you experience the issue of another shell's
> escape sequences being used that typeset won't warn of since it isn't
> being used.
What I proposed would address the issue of zsh exporting $PS1 and some
other shell then using zsh's value (e.g., «export PS1='%# '; dash»). What
you're describing is the converse problem and would need to be fixed
separately.
> the second issue being software like python's virtualenv
> being written under the assumption that exporting PS1 won't cause an
> warning message in the shells their activation script is written for,
> would need to now account for that.
Isn't that a bug in their code that they should fix? PS1 shouldn't be exported.
Incidentally, if they do the equivalent of «env PS1=foo zsh», then they
won't be affected because that doesn't go through bin_typeset() in the
first place. They'd only be affected if they somehow cause the 'export'
or 'typeset' builtins to be executed (e.g., by setting up their own
$ZDOTDIR).
> I know i have offered critiques yet no solutions, but i don't think
> either of the suggestions is ideal personally.
prev parent reply other threads:[~2020-07-30 4:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 14:32 Perette Barella
2020-07-29 14:39 ` Roman Perepelitsa
2020-07-29 15:15 ` Perette Barella
2020-07-29 15:21 ` Eric Cook
2020-07-29 23:07 ` Daniel Shahaf
2020-07-30 3:56 ` Eric Cook
2020-07-30 4:30 ` Daniel Shahaf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f9d21359-ba6d-4aea-a264-4d9b87ad4c63@www.fastmail.com \
--to=d.s@daniel.shahaf.name \
--cc=llua@gmx.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).