markfink / whaaaaat

Inquirer.js port to Python (https://www.npmjs.com/package/inquirer). people blame me for staling this project. I do not have time to work on this right now - whaaaaat do you want me to do? take it offline?
MIT License
83 stars 9 forks source link

Support for new lines and tabs #5

Closed woile closed 6 years ago

woile commented 6 years ago

Hi guys, great tool! I really like it. I was wondering if would be possible to include support for \t and \n, mostly in the choices.

I would like to be able to do something like this:

{
    'value': 'foo',
    'name': 'bar \t\t some description about this',
},

Thanks a lot!!

markfink commented 6 years ago

glad you like it.

technically what you ask should not be a problem. In fact I might already work: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/docs/pages/building_prompts.rst but I have never tried.

currently whaaaaat does what I need it to do so I have no further work planned util prompt-toolkit 2.0 comes out (might bring a lot of changes)

however if you submit a decent PR (incl. docs, tests an all), I promise to support you to get it in.

woile commented 6 years ago

Hi thanks for the answer, I've been reading the link you shared and I cannot find anything related about this. Not even in google. I see now that it also happens in prompt toolkit.

Check the result is quite wierd:

In [3]: prompt('foo\t\tbar')
foo^I^Ibar

I might be missing something here haha Thanks again and if I found a way to solve it I'll share!

PS: By the way \n works as expected