zsh-workers
 help / Atom feed
* Possibly a bug involving rcs flag on mac?
@ 2019-02-19 23:04 Guðmundur Páll Kjartansson
  2019-02-20  2:06 ` Eric Cook
  2019-02-20  5:11 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Guðmundur Páll Kjartansson @ 2019-02-19 23:04 UTC (permalink / raw)
  To: zsh-workers

Greetings

I have some strange buggy behaviour going on. If I run zsh in a bash
terminal window, it will not run .zshrc:

$ zsh

If I instead do this:

$ zsh --rcs ~/.zshrc

Then it will run .zshrc ... but it will also exit immediately ... this
happens even if I run it in interactive mode:

$ zsh --interactive ~/.zshrc

If I add the below lines to the top of my .zshrc file, I can clearly
see the difference in having the --interactive flag ... but it exits
immediately either way:

echo "running zshrc"
if [[ -o interactive ]]; then; print yes; else; print no; fi

I am using zsh version 5.7.1 ... I also tried it with 5.6.2 and even
5.3 ... but no luck ...

I tried doing the same thing on my friends mac ... and there it worked
without any problems (just running zsh straight from bash) ...

Any idea what the issue might be?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Possibly a bug involving rcs flag on mac?
  2019-02-19 23:04 Possibly a bug involving rcs flag on mac? Guðmundur Páll Kjartansson
@ 2019-02-20  2:06 ` Eric Cook
  2019-02-20  5:11 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Cook @ 2019-02-20  2:06 UTC (permalink / raw)
  To: zsh-workers

On 2/19/19 6:04 PM, Guðmundur Páll Kjartansson wrote:
> Greetings
> 
> I have some strange buggy behaviour going on. If I run zsh in a bash
> terminal window, it will not run .zshrc:
> 
> $ zsh

What is the output of zsh --sourcetrace #?


and

# this will dump the startup to an pastebin website,
# you can skip it if you have private stuff in there.
zsh -ixc : 2> >(curl -n -F 'f:1=<-' http://ix.io)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Possibly a bug involving rcs flag on mac?
  2019-02-19 23:04 Possibly a bug involving rcs flag on mac? Guðmundur Páll Kjartansson
  2019-02-20  2:06 ` Eric Cook
@ 2019-02-20  5:11 ` Bart Schaefer
  2019-02-20 13:48   ` Guðmundur Páll Kjartansson
  1 sibling, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2019-02-20  5:11 UTC (permalink / raw)
  To: Guðmundur Páll Kjartansson; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

On Tue, Feb 19, 2019, 3:05 PM Guðmundur Páll Kjartansson <gpk188@gmail.com
wrote:

> Greetings
>
> I have some strange buggy behaviour going on. If I run zsh in a bash
> terminal window, it will not run .zshrc:
>
> $ zsh
>

I'm not sure what to say about that; is it possible that $HOME is set
incorrectly or that $ZDOTDIR is set?  Does zsh appear otherwise to be
interactive, i.e., it prints prompts and ZLE is working?

If I instead do this:
>
> $ zsh --rcs ~/.zshrc
>
> Then it will run .zshrc ... but it will also exit immediately


You have misunderstood how the shell options work.  If you give the shell a
file name as an argument, it reads that file for commands and then exits.
The --rcs option does not change that, it merely says that it's OK for the
shell to read the usual startup files as well (where "usual" depends on
whether the shell is interactive, is a login shell, etc.).

--rcs is the default, so ordinarily one would be using --norcs to turn them
off instead.

... this
> happens even if I run it in interactive mode:
>
> $ zsh --interactive ~/.zshrc
>

Yes, even if the shell is interactive a filename argument means to read the
file and exit.

To force the shell NOT to read commands from the argument file, you must
use the --shinstdin option.  There is no simple way to cause the shell to
first read a file and then continue reading from stdin / the terminal.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Possibly a bug involving rcs flag on mac?
  2019-02-20  5:11 ` Bart Schaefer
@ 2019-02-20 13:48   ` Guðmundur Páll Kjartansson
  0 siblings, 0 replies; 4+ messages in thread
From: Guðmundur Páll Kjartansson @ 2019-02-20 13:48 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]

>
> I'm not sure what to say about that; is it possible that $HOME is set
> incorrectly or that $ZDOTDIR is set?

This was my problem ... I had completely forgotten about $ZDOTDIR. I just
found out that in one case the shell was running ~/.zshrc and in the other
case $ZDOTDIR/.zshrc

I managed to fix that issue by letting one of those files source the other.


> You have misunderstood how the shell options work.

Yes ... I mistakenly thought that --rcs worked the same way as --rcfile in
bash

Thank you for your help!


On Wed, Feb 20, 2019 at 5:11 AM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Tue, Feb 19, 2019, 3:05 PM Guðmundur Páll Kjartansson <gpk188@gmail.com
> wrote:
>
>> Greetings
>>
>> I have some strange buggy behaviour going on. If I run zsh in a bash
>> terminal window, it will not run .zshrc:
>>
>> $ zsh
>>
>
> I'm not sure what to say about that; is it possible that $HOME is set
> incorrectly or that $ZDOTDIR is set?  Does zsh appear otherwise to be
> interactive, i.e., it prints prompts and ZLE is working?
>
> If I instead do this:
>>
>> $ zsh --rcs ~/.zshrc
>>
>> Then it will run .zshrc ... but it will also exit immediately
>
>
> You have misunderstood how the shell options work.  If you give the shell
> a file name as an argument, it reads that file for commands and then
> exits.  The --rcs option does not change that, it merely says that it's OK
> for the shell to read the usual startup files as well (where "usual"
> depends on whether the shell is interactive, is a login shell, etc.).
>
> --rcs is the default, so ordinarily one would be using --norcs to turn
> them off instead.
>
> ... this
>> happens even if I run it in interactive mode:
>>
>> $ zsh --interactive ~/.zshrc
>>
>
> Yes, even if the shell is interactive a filename argument means to read
> the file and exit.
>
> To force the shell NOT to read commands from the argument file, you must
> use the --shinstdin option.  There is no simple way to cause the shell to
> first read a file and then continue reading from stdin / the terminal.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 23:04 Possibly a bug involving rcs flag on mac? Guðmundur Páll Kjartansson
2019-02-20  2:06 ` Eric Cook
2019-02-20  5:11 ` Bart Schaefer
2019-02-20 13:48   ` Guðmundur Páll Kjartansson

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/ public-inbox