Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: allow zsh to source a script and then become interactive



On Apr 15,  1:00am, Daniel Shahaf wrote:
} Subject: Re: allow zsh to source a script and then become interactive
}
} Anthony Fletcher wrote on Fri, Apr 14, 2017 at 18:03:42 -0400:
} > See the extra "teapot% " prompt that sneaks in. Instead run
} > 
} > PS1='' zsh -fis <<<"source /tmp/setup </dev/tty && exec </dev/tty"
} > 
} > and it does the desired thing. Brilliant.
} 
} You must be using an older version.  In current versions, PS1 is no
} longer read from the environment, so you should set it to empty inside
} the here string.

Setting it in the here-string is too late.  The prompt is printed even
before the here-string is read.

However, I tried it, and PS1 is imported by zsh built from current git.

The parameters not imported are:
    _
    *
    #
    EGID
    EUID
    GID
    histchars
    HISTCHARS
    IFS
    KEYBOARD_HACK
    module_path
    OPTIND
    path
    PS4
    TRY_BLOCK_ERROR
    TRY_BLOCK_INTERRUPT
    UID
    USERNAME
    zsh_eval_context



Messages sorted by: Reverse Date, Date, Thread, Author