Commit Graph

60 Commits

Author SHA1 Message Date
Benjamin Staneck
bb312ad74b try --no-lock-index for Git 2016-09-17 22:48:02 +02:00
Jan Schulz
6b10771312 Parse the original prompt for cwd and env names
clink.get_cwd() is returning a string which is differently encoded than what
clink.prompt.value expects. This results in garbled path names if the path
condains non-ASCII chars. The (arguable hacky) solution is to parse the old
prompt for the current directory (which breaks if the user sets a PROMPT env var
which is incompatible to the regex used here...).

Also parse out a environment name set by systems like virtualenv or conda: this
could be done more specifically by targeting each such system and using the
usually set environment variable but this would mean that we would have to do
that for each and every such system out there and that is probably not a sane
idea...
2016-08-09 13:45:36 +02:00
Benjamin Staneck
13fd41eb82 change how we ask hg for the status
closes #1035
Thanks @raleighr3
2016-07-30 00:36:32 +02:00
Benjamin Staneck
924ab12aeb we don't need a second function for that. 2016-06-30 02:53:00 +02:00
Łukasz Papierz
9c0ad9fd81 Fix git branch name colouring
Colouring fixed when there are some changes in a branch
2016-06-28 14:13:35 +02:00
Jan Schulz
a542f4e20c cmd: change the prompt in lua
This keeps the PROMPT variable as is and changes the prompt to the cmder style
in the clink code.

This has two advantages:

* opening a cmd in a cmder session will now show the old prompt code instead of
  a ugly raw prompt without the replacements. This led to ugly output when a
  batch file echoed their content (e.g `conda build recipe/`).

* when a command rewrites the prompt (e.g. an activate in a virtualenv), these
  command sometimes simply overwrites the PROMPT so that the cmder enhancements
  were not anymore in place. Now we simply don't care and overwrite it with our
  stuff in the clink part. This might mean that a user has to install a lua
  script so that e.g. conda environments are visible on the prompt.
2016-06-21 13:33:49 +02:00
Jan Schulz
c19412045c Fix git branch name never shown as dirty
The problem was that io.popen() returns a file and not the return code of the
called program.

The new code was inspired by
http://stackoverflow.com/a/14031974/1380673
2016-06-02 12:45:07 +02:00
Gregory Pakosz
64d981e470 Fixed get_git_dir() to take submodules into account. Fixes #833 2016-02-16 11:15:42 +01:00
Jan Schulz
fe45b186e0 clink.lua: add header
Introduce a header like in the rest of the scripts that this file
is overwritten on updates and should not be modified.
2016-01-15 18:06:35 +01:00
Jan Schulz
788b5262b4 Reorganize how clink settings are loaded
4bfdf04d59 moved all clink config files
to vendor/ and therefore the files in config/ were not used and .history
was also moved to vendor/.

The new arrangement uses `--script` to load our own clink.lua file which in
turn as the first thing loads the original clink.lua file. The user defined
files are again in config/. As clink regenerates these files, if they are not
present, this also means that we don't need to include the settings file
in the git repo and therefore don't overwrite it on updates.
2016-01-15 18:02:10 +01:00