zsh-workers
 help / color / mirror / code / Atom feed
* bug report: INTERACTIVECOMMENTS option interacts oddly with shell functions in an interactive context
@ 2021-08-29 20:55 Glyph
  2021-08-30 21:35 ` Bart Schaefer
  0 siblings, 1 reply; 14+ messages in thread
From: Glyph @ 2021-08-29 20:55 UTC (permalink / raw)
  To: zsh-workers

If we have a shell file like this, designed to be sourced:


#!/bin/zsh

function sample_function () {
    (
        setopt INTERACTIVECOMMENTS;
        # interactive comment test
        local bogus="$(
            # test comment
            echo "sample value";
        )";
        echo "${NOTSET:-${bogus}}";
    )
}

Comments in sample_function are interpreted normally, but comments *inside* the "bogus" expression will be interpreted as executing in an interactive context, and will therefore cause errors if INTERACTIVECOMMENTS is not set, if the overall shell is interactive.

Thanks,

-g

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

end of thread, other threads:[~2021-09-09 19:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-29 20:55 bug report: INTERACTIVECOMMENTS option interacts oddly with shell functions in an interactive context Glyph
2021-08-30 21:35 ` Bart Schaefer
2021-08-31  6:03   ` Stephane Chazelas
2021-09-01  3:41     ` Bart Schaefer
2021-09-01  7:55       ` Stephane Chazelas
2021-09-01 15:17         ` Peter Stephenson
2021-09-01 17:55           ` Bart Schaefer
2021-09-01 18:09           ` Bart Schaefer
2021-09-01 18:23             ` Stephane Chazelas
2021-09-01 18:41               ` Stephane Chazelas
2021-09-01 18:43               ` Bart Schaefer
2021-09-02  9:04             ` Peter Stephenson
2021-09-09  3:50               ` Bart Schaefer
2021-09-09 19:06                 ` Peter Stephenson

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).