e.g. history > /tmp/commands_history
.xonshrc will not be executed so you need to add/change this to .config/xonsh/config.json :
$ cat /tmp/feed_hist_to_xonsh
#!/usr/bin/expect
# read the commands to run
# CUSTOMIZE THE PATH at the line below
set f [open "/tmp/commands_history"]
set commands [split [read $f] "\n"]
close $f
spawn xonsh
# Send commands giving an extra enter at the end (in case xonsh expects more input),
# and if instead of the ### prompt you get .. (xonsh still waits for more input) send ctrl-C
# ctrl-c will cancel this specific command which doesn't work as expected in xonsh
foreach cmd $commands {
You need to add a return as the first statement of the run_compiled_code function in /usr/local/lib/python3.5/dist-packages/xonsh/amalgam.py
(Note that you must have another shell available to execute commands after this change)
def run_compiled_code(code, glb, loc, mode):
expect /tmp/feed_hist_to_xonsh
This was crashing every some thousand commands and I had to delete the already processed commands and then rerun expect
--
You received this message because you are subscribed to the Google Groups "xonsh" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xonsh+unsubscribe@googlegroups.com.
To post to this group, send email to xo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xonsh/4c4c1799-80ad-4f22-ac63-4efe2f07daad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to xonsh+un...@googlegroups.com.