Franklin Yu
Franklin Yu
I wonder whether we need to detect interactive shell in `auto.sh`. As far as I understand, `auto.sh` is only intended for interactive shell; non-interactive shell should use `chruby-exec` which only...
> How about providing a common `chruby_hook` function that provides an entry-point for any/all hooks that run after every command, which `auto.sh` adds to. Isn’t that exactly `preexec`?
Then I’m once again advertising for https://github.com/rcaloras/bash-preexec, which saves us from manually fiddling with `DEBUG` trap (which is difficult to get right, anyway). It also fixes #367 for free: https://github.com/rcaloras/bash-preexec/blob/master/test/bash-preexec.bats#L198-L212...
For example, what if we have `chpython`, `chnode`, and `chperl`? Compare the hook solution ```bash function chruby_hook() { chpython_auto } function chpython_hook() { chnode_auto } function chnode_hook() { chperl_auto }...
I’m recommending detecting `bash-preexec`. I’m not suggesting vendoring it.
@HaleTom Does that work with https://github.com/rcaloras/bash-preexec? Because I also wish chruby to work with Bash-Preexec (#399).
Any news about this? Either #406 or #424 would work for me.
I think this is a general issue of compatibility with `bash-preexec`, not specific to iTerm2 or macOS. How about detecting whether `preexec_functions` exists? This way we simply make use of...
From ReadMe: > ### Anti-Features > - Does not hook `cd`. I guess it’s because aliasing `cd` has already been in many user’s `.bashrc`.
Would it be better to solve https://github.com/postmodern/chruby/issues/390#issuecomment-318863234 instead?