Coder Social home page Coder Social logo

Comments (7)

sloria avatar sloria commented on May 23, 2024 1

You might be able to fake it by using #doitlive env and #doitlive alias (https://doitlive.readthedocs.io/en/stable/#comment-magic-configuration) to set the things conda needs. Other than that, I'm afraid I can't provide much other help, so closing.

Please post here if you get it working.

from doitlive.

sloria avatar sloria commented on May 23, 2024

I don't have any experience using doitlive with conda, so I can't provide much help here. Hopefully other users can provide assistance.

from doitlive.

omry avatar omry commented on May 23, 2024

How are you creating the shell?
For some reason many things are behaving differently, tab completion, history search with up and down etc.

from doitlive.

sloria avatar sloria commented on May 23, 2024

Each command is written to a file then executed within a subprocess:

# Need to make a temporary command file so that $ENV are used correctly
# and that shell built-ins, e.g. "source" work
with NamedTemporaryFile("w") as fp:
fp.write("#!{0}\n".format(shell))
fp.write("# -*- coding: utf-8 -*-\n")
# Make aliases work in bash:
if "bash" in shell:
fp.write("shopt -s expand_aliases\n")
# Write envvars and aliases
write_commands(fp, "export", envvars)
write_commands(fp, "alias", aliases)
if extra_commands:
for command in extra_commands:
line = "{}\n".format(command)
fp.write(ensure_utf8(line))
cmd_line = cmd + "\n"
fp.write(ensure_utf8(cmd_line))
fp.flush()
try:
if test_mode:
output = subprocess.check_output([shell, fp.name])
echo(output)
else:
return subprocess.call([shell, fp.name])
except KeyboardInterrupt:
pass
. 😬

from doitlive.

omry avatar omry commented on May 23, 2024

I see, this explains it.
conda requires some changes to the shell (new functions, aliases etc).
it can't work if the shell does not persist.

Wouldn't it be better to keep a shell open and send keys to it's stdin and read from it's stdout?

from doitlive.

sloria avatar sloria commented on May 23, 2024

I think I had tried that but it didn't work for reasons I've since forgotten...maybe it wasn't feasible to get python mode working. ¯\(ツ)

from doitlive.

omry avatar omry commented on May 23, 2024

oh well.
seems to be working with asciinema, but real time makes things hard.
https://asciinema.org/a/0SSPYKs0h9u5XnmSDln0ET8y7

from doitlive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.