Andy Kipp

Results 609 comments of Andy Kipp

And think the start point to diving into this is [resolve_redirect](https://github.com/xonsh/xonsh/blob/c84420e7b35c3a61a0a76074cd43510d51182dc5/xonsh/procs/specs.py#L694)

Hi @gforsyth! I've merged two versions of one file and to avoid this mess in the future I suggest to remove/archive this repository with moving the result code to [xonsh/completers/bash_completion.py](https://github.com/xonsh/xonsh/blob/main/xonsh/completers/bash_completion.py)....

### Workaround Use return_command alias (recommended): ```xsh @aliases.register @aliases.return_command def _t(args): return ['echo', str(2+2)] + args ``` Using pure callable alias e.g.: ```xsh @aliases.register def _t(): echo 1 && echo...

### Searching for a root issue `ExecAlias("echo 1 && echo 2")` is a callable alias that has `execer.exec` inside. The `execer.exec` does `compile` and `exec` the code `"echo 1 &&...

The minimal PoC: ```xsh @aliases.register def _e(): execx("echo 1") # the same as `__xonsh__.execer.exec("echo 1")` from ExecAlias e e e # Bad file descriptor ``` To reproducing: ```xsh @aliases.register def...

I see that [`self.c2pwrite`](https://github.com/xonsh/xonsh/issues/5631#issuecomment-2250262771) comes from `self.stdout` from `xonsh.procs.specs._make_last_spec_captured` where `os.pipe()` created. After test it looks `os.pipe()` has very fragile behavior - it returns the descriptor to the pool after...

(1) I think this bug was introduced in #3897. Here we create pipe and open it with `"w"`: https://github.com/xonsh/xonsh/blob/32d72af53d5e858b617c8a10c531b67e561f8421/xonsh/procs/specs.py#L913-L915 Then we put the descriptor to variable: https://github.com/xonsh/xonsh/blob/32d72af53d5e858b617c8a10c531b67e561f8421/xonsh/procs/proxies.py#L699 And then we...

@gforsyth I think we need your help here because this issue's making ExecAlias functionality unstable. May be as reviewer of #3897 you can catch the idea behind the code I...

On my experience of tracing this I see: * The issue appears randomly. It looks like it depends on time. So +1 to garbage collector and descriptors closing. * The...

I've added code to reproducing - https://github.com/xonsh/xonsh/issues/5631#issuecomment-2250423483 ```xsh @aliases.register def _e(): execx("echo 1") for i in range(0, 30): echo -n 2 $(e) # 2'1' # 2'1' # 2'' #