Commits

Christopher Nilsson committed 106424e

activate.fish acknowledges '--prompt' now (still ignores though)

  • Participants
  • Parent commits edb16dd

Comments (0)

Files changed (2)

 
 ##file activate.fish
 ACTIVATE_FISH = """
-eJydVltv2koQfudXTBfQgQqM+lqplahCBVICUUIjHbWVtdhjvIq9S3fXOOmv76xtjM0lPTo8JPbu
-XL6Z+WbGXVjHwkAkEoQ0MxY2CJnBEHJhY2AebISc8MCKPbfoRcLEDN5HWqXgnt/DILZ293EycW8m
-xiTxlN4OO114VRkEXEplQWcShIVQaAxs8trpRJkki0pCiAfTAOMQ2OyF5PZC24wnKPfAZQgabaYl
-WAVS6ZQnULgBuhZayRSlZR2gX5ckDVpQSdi8hD3Xgm8SNIWUiMAihTmWwHr+6vbGf1o8rL9Nb/37
-6XrOoBByP2dqvH0Bdwznkm05hMsCKMO/ef13PV8t56u7GTt3Xd+dAqgv3obRFnNgrqD5unic+/cP
-q7v7tb96mj08LG4aeA7lMs6DK7S/IwLs7EXnl0y13VfSB5Sz5VMLFetxvd1///CTwbtPwKSSIR3r
-zBEFj6C68IhJBIe7d5fRHglWYyhwdCGTDofQGhO+b/Okwcq2907nUJoGeGC+33j1fXYUO2MF9Apu
-tMjFeg31ie9/WSz95fRuRpYq8RpugxGULjrplP9g/AtOqn0ZQoNRl+SxaaVIVM2V322c/s3icfrl
-dlaV+tCCjh1Vg9IUMcDrcoxASGORh6Ai158u32ZUqVFzE6XCLECwMUJJLw9We9RahEJui2N8Eca6
-l3p+0ORCbl69ysxc5UgqI+BhqaQKvSCjKlOFS7NOiUMirHUjT2mEXOnnykRlaLlazz7CoxUuDmky
-EopVXsHcixDBZLud0hYipcm+sTQQS/NmRAOMV3ag8F9nv0gVpFw/o/ZgsaWBVoRDNpxcqtzA8o7l
-SNwwK80WA3pgMd25p2GrY3rGcpuZRmsYonQr9EbX1tnzPK9WwSBWwOq8+uTXb+gw+PwZei0wbVUa
-JT+6bwgdm7KJ5Lp8F3L8h2JIeVgGws4hOYURGJVpoo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tieKBVCIdWz
+fzilzPaYyljZN0cGN1v7NnaIPNCGmVy3GKuJaQ6iVjE1Qfm+36hglErwmnAD8hu0dDy4uICBA8ZV
+pQr/q/+O0KFW2kjelu9Dgb9SDBsWV4F4x5CswgS0zBVlk5tDMP5bVtUGpslbm81Lu2sdKq7uNMGh
+MVQ4fy9xhogC1lS5guhISa0DlBWv0O8odT6/LP+4WZzDV6FzIkEqC0uolGZSZoMnlpxplmD2euaT
+O4hkTpPnbztDccey0bhjDaBIqaWQa0uwEtQEwtyU56i4fq54F9IE3ORR6mKriODM4XOYZwaVYLYz
+7SPbKkz4i7VkB6/Ot1upDE3znNqYKpM8raa0Bx8vfvntJ32UENsM4aI6gJL+jJwhxhh3jVIDOcpi
+m0r2hmEtS8XXXNBk71QCDXTBNhhPiHX2LtHkrVIlhoEshH/EZgdq53Eirqs5iFKMnkOmqZTtr3Xq
+djvPTWZT4S3NT5aVLgurMPUWI07BRVYqkQrmtCKohNY8qu9EdACoT6ki0a66XxVF4f9AQ3W38yO5
+mWmZmIIpnDFrbXakvKWeZhLwhvrbUH8fahhqD0YUcBDJjEBMQwiznE4y5QbHrbhHBOnUAYzb2tVN
+jJa65e+eE2Ya30E2GurxUP8ssA6e/wOnvo3V78d3vTcvMB3n7l3iX1JXWqk=
 """.decode("base64").decode("zlib")
 
 ##file activate.bat

virtualenv_support/activate.fish

 if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
     # fish shell uses a function, instead of env vars,
     # to produce the prompt. Overriding the existing function is easy.
-    # However, adding to the current prompt is a little more work.
-    #
-    # NOTE: Still unsure how to provide support for custom prompts, via
-    #   the VIRTUAL_PROMPT marker. Ignoring for the moment.
+    # However, adding to the current prompt, instead of clobbering it,
+    # is a little more work.
     set -l oldpromptfile (tempfile)
     if test $status
         # save the current fish_prompt function...
         . $oldpromptfile
         rm -f $oldpromptfile
         
+        if test -n "__VIRTUAL_PROMPT__"
+            # We've been given us a prompt override.
+            # 
+            # FIXME: Unsure how to handle this *safely*. We could just eval()
+            #   whatever is given, but the risk is a bit much.
+            echo "activate.fish: Alternative prompt prefix is not supported under fish-shell." 1>&2
+            echo "activate.fish: Alter the fish_prompt in this file as needed." 1>&2
+        end        
+        
         # with the original prompt function renamed, we can override with our own.
-        function fish_prompt
+        function fish_prompt                
             set -l _checkbase (basename "$VIRTUAL_ENV")
             if test $_checkbase = "__"
                 # special case for Aspen magic directories