PyInquirer icon indicating copy to clipboard operation
PyInquirer copied to clipboard

prompts/checkbox please make "mouse_support" variable.

Open SAPhRAXsg opened this issue 6 years ago • 8 comments

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?

SAPhRAXsg avatar Jun 01 '19 08:06 SAPhRAXsg

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

CITGuru avatar Jun 01 '19 08:06 CITGuru

If so how would you propose to be done

CITGuru avatar Jun 01 '19 08:06 CITGuru

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

gslavin avatar Jun 11 '19 00:06 gslavin

Thats more of a feature. This is doable.

CITGuru avatar Jun 15 '19 10:06 CITGuru

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

mcharrel avatar Jun 20 '19 13:06 mcharrel

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.

paddie avatar Jul 11 '19 13:07 paddie

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.

btashton avatar Oct 18 '20 23:10 btashton

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`

awalasz avatar Aug 26 '21 09:08 awalasz