CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 236 forks source link

prompts/checkbox please make "mouse_support" variable. #57

Open SAPhRAXsg opened 5 years ago

SAPhRAXsg commented 5 years ago

Hi there

in the libary "prompt_toolkit" wich is used, the variable "mouse_support" is changeable calling function prompt(.., mouse_support=False) in file ./prompts/checkbox.py the option is hard coded on TRUE. Is is possible to set this option with an argument?

CITGuru commented 5 years ago

Yes it is hard coded. You want to be able to change it? Lemme see if that is something needed

CITGuru commented 5 years ago

If so how would you propose to be done

gslavin commented 5 years ago

Not sure about the reporter's use case, but I would like to disable mouse input globally while using PyInquirier.

CITGuru commented 5 years ago

Thats more of a feature. This is doable.

mcharrel commented 5 years ago

+1 I'd also like to disable mouse input.

paddie commented 4 years ago

yes, right now it breaks whenever you select another window and return to the dialog by clicking the body of the terminal. Most inconvenient. A global option would be preferable though.

btashton commented 3 years ago

It would be nice if this was an optional field in question dict. Right now I am rendering the prompt after a bunch of text that someone might want to copy from before selecting a response.

awalasz commented 2 years ago

Hi, there is another issue related to that. If you have a 'list' question, then when clicking to option it's correctly selected but answers are empty and not returned.

questions = [
    {
        'type': 'list',
        'message': 'Select source environment',
        'name': 'env_src',
        'choices': [
            {"name": name, "value": value}
            for name, value in get_connections().items()
        ],
    },
]

answers = prompt(questions, style=style)
print(answers)  # Empty dict if option clicked by mouse
print(answers['env_src']  # raises `KeyError`