rtomayko / git-sh

A customized bash environment suitable for git work.
GNU General Public License v2.0
737 stars 83 forks source link

Let `enter` output `git status` #38

Open lode opened 9 years ago

lode commented 9 years ago

From https://github.com/thoughtbot/gitsh I loved the feature of using enter to get the current git status. It feels very natural and a handy shortcut.

(I do like how most commands, i.e. also arrow keys, are given to the normal systems prompt, that should not change in its base.)

nikreiman commented 9 years ago

I don't think that this is technically possible. It works in gitsh because that is a separate executable program, and can thus can handle enter separately. However, git-sh is just a set of shell aliases and extensions build on top of bash, and afaik bash does not offer a way to do this other than PROMT_COMMAND, which as the name suggests actually executes on every command (whether it was empty or not).