Closed nia-potato closed 3 months ago
hey @FergusFettes feel free to take a look at this whenever you have time, but i've tried to modify your shell() to
def shell(ctx: Context):
"""Drop into an ipython shell"""
import IPython
env = os.environ.copy()
IPython.embed(user_ns=env)
and other similar tests to inherit the parent shell behaviors but still had no avail.
@nia-potato hmm, im not sure if this will work-- you cant use bash binaries directly in python shells in general i think.
but I can still use the bash elements in the parent environment like so:
p/txt/typer-shell> export TEST='asdf'
p/txt/typer-shell> poetry run python demo.py
Welcome to typer-shell! Type help to see commands.
🔥: shell
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.
In [1]: !echo $TEST
asdf
In [2]:
If that isn't what you are looking for, please clarify.
Hi, thanks for the great project.
I just discovered typer and interactive shells a few weeks ago so please excuse me if this is something obvious.
I currently converted my existing cli to a interactive shell so that data structures that needed to be pre-loaded in the background can be utilized better in a interactive shell session.
however my cli program relied on commands/binaries in the parent shell to work such as gcloud kubectl, etc is there anyway that make_typer_shell will allow the creation of the current user shell configs as a new shell with the interactive components?