thoughtworks / talisman

Using a pre-commit hook, Talisman validates the outgoing changeset for things that look suspicious — such as tokens, passwords, and private keys.
https://thoughtworks.github.io/talisman/
MIT License
1.92k stars 241 forks source link

Interactive mode on Windows #235

Open harinee opened 4 years ago

harinee commented 4 years ago

Is your feature request related to a problem? Please describe. As per #228 the interactive mode did not work properly for Windows. It rendered Windows unusable, whether the feature was turned on or not.

Describe the solution you'd like The interactive mode helps people an assisted way to enter contents to ignore through an interactive shell. This needs to be exactly same for Windows, as it works for Unix.

  1. When variable TALISMAN_INTERACTIVE is set to true, an interactive shell should be enabled, which prompts and accepts inputs from users for ignoring false positives during commits
  2. When installing, Windows should also provide a choice to users to install with interactive mode by default
  3. talisman -g pre-commit -i will take you to the interactive mode if we have staged changes. This should also work on Windows

Additional context For reference, see how Talisman operates on Unix system, and just ensure it works for Windows in the same manner. While testing, do ensure Unix doesn't break with the implementation.

Consider git bash at least. Even better if it supports powershell as well

dcRUSTy commented 4 years ago

Additional Context https://github.com/AlecAivazis/survey/issues/148 Issue in GitBash+Interactive mode library

dcRUSTy commented 4 years ago

Before proceeding any further with this....

talisman_winpty

@harinee @svishwanath-tw is it fine? or we need to change from https://github.com/AlecAivazis/survey/ to something else?

dcRUSTy commented 4 years ago

From v2.27.0 git has support for winpty/conpty if correct option is selected while installing git.. https://github.com/git-for-windows/git/releases/tag/v2.27.0.windows.1

else on git bash winpty talisman inplace of talisman works