mitsuhiko/dialoguer

A rust library for command line prompts and similar things

dialoguer

.

Issues

Collection of the latest Issues

cryeprecision

cryeprecision

c-theme
Comment Icon0

When using the ColorfulTheme, the tick-symbol (✔/) is shown as an emoji. Therefore the color is not shown anymore and you can't distinguish between checked and unchecked.

I have this problem on Windows 10 21H1 when using Windows Terminal.

A solution would be to change the prefix for unchecked items to (❌/) or something similar.

https://github.com/mitsuhiko/dialoguer/blob/3f16bdedf885d98a90273bd57ec243d71da1b462/src/theme.rs#L336-L337

kodematthieu

kodematthieu

Comment Icon1

For example you call Confirm::new("Do you want to continue").interact_opt() and on the terminal you enter CTRL+C, the cursor will remain hidden. This is acceptable though because the program terminates and does not allow you to exit cleanly.

But for example you have signal-hook to handle signals, the program will continue with the cursor still hidden. I think this should be handled by the crate as it was the one that hid the cursor

indygreg

indygreg

c-editor
Comment Icon0

Thank you for this terrific crate!

When attempting to use the editor prompt on Windows 11, notepad.exe is successfully opened with the contents of the temporary file rendering. However, when notepad goes to save the file, it brings up a file dialog prompting you of the location to save the file. On my machine, this defaults to to ~/Documents.

However, if I exit the Rust process, the file saves fine.

I think this is due to how Windows locks files. Specifically, you can't open a file for writing if another process has an active [write] handle on it unless you just through hoops. In this crate, the tempfile crate has a handle on the file, effectively locking out other writers.

A common solution to this problem is to create a temporary directory then create and close handles on a file within that. The contents of the temporary directory will get purged on drop. But you don't have to worry about multiple processes having a handle on the temporary file. This approach also enables you to give the temporary file a nice name, which could provide UI wins.

joepio

joepio

p-input
Comment Icon0

Hi there! Thanks for creating this :)

I have some input fields that are optional. I'd like to have an API similar to this:

Maybe I'm missing something in the docs, but I don't really see how I should achieve these optional inputs.

I know you can use .allow_empty, but that doesn't really work for things like numbers.

deg0nz

deg0nz

Comment Icon0

I found this bug while implementing #179.

As you can see in the gif in the PR, at some point the end of the prompt prints the characters for the arrow down keyboard. But this also happens with normal characters entered to the prompt.

Here's a screenshot: Screenshot 2022-03-06 at 17 52 32

Unfortunately, I was not able to spot the source of the error. Maybe someone could help here. I would like to implement a fix if someone could point me in the right direction.

The error is not directly reproducible. I tried many character combinations but it seems to only happen when I quickly enter characters, so this could be a timing issue somewhere.

deg0nz

deg0nz

Comment Icon1

I looked a little further into the issue we discussed in #130.

So far, I found a solution for *nix systems. The foreground process gets the SIGWINCH signal when a terminal is resized. I tried catching it as described here and it seems to work:

sigwinch-test

We could just create another feature that hooks into the signal and then let the screen re-render itself.

This would add 1 additional dependency if we go the way where we spawn a dedicated thread that observes the signal as in the example above (signal-hook).

Unfortunately, I don't really know how the Windows part would look like. After some quick research, maybe ResizePseudoConsole could be used for this ?! It would be nice if someone could help out here...

deg0nz

deg0nz

p-select
Comment Icon2

Hi,

is there any planning or opinion about using the full width of a terminal for listing the elements of select prompts? I mean the type of listing ls does without any arguments, so all the elements are listed in a table-like way.

Are there any plans to have this as a feature? If not, why not?

The only thing that comes to my mind where this could be a problem is fuzzy-select because of the cursor movement in the search field. But I'm sure we could think of something to make it work.

I couldn't find any issues about this, so sorry if I've overseen this if it has been discussed before.

If this is a desired feature, I would start thinking about this and implement this feature. ✌️

grunweg

grunweg

t-bug
Comment Icon1

Thanks for this crate, by the way. I could insert a simple terminal prompt without knowing too much about terminals!

Steps to reproduce. Take this small test programm.

  1. Build and run the programm: cargo r
  2. A confirmation prompt appears:

Prompt string with multiple lines: Line two?

  1. Answer either yes or no (doesn't matter which).
  2. My answer is displayed in the terminal.

Expected result The terminal output looks like this:

Prompt string with multiple lines: Line two yes

Actual result The prompt is printed twice, resulting in output like this.

Prompt string with multiple lines: Prompt string with multiple lines: Line two yes

Meta. Tested on both version 0.9 and 0.8 of dialoguer.

sunshowers

sunshowers

t-bug
Comment Icon2

Hi there, thanks for dialoguer!

I noticed that in the default ColorfulTheme, some of the entries (prompt_suffix and success_suffix) are marked as being black:

https://github.com/mitsuhiko/dialoguer/blob/29da763bf7221d8f072bab0bdab9a29322e9e8f9/src/theme.rs#L290-L292

Since many terminal themes don't contrast "black" against dark backgrounds (and the same for "white"), it can be pretty hard to read the prompt on those backgrounds.

I'm wondering if it's possible to change this to one of the other 12 colors in the 4-bit color palette. Seems like an easy (and non-breaking) change. What do you think?

9999years

9999years

t-bug
Comment Icon1

Expected behavior: When dialoguer::Input::interact is running and I press Ctrl-D, STDIN is closed and interact() returns an Err.

Actual behavior: The previous line in the terminal is replaced by the input prompt, which is moved up one line, and dialoguer keeps waiting for input. Repeatedly pressing Ctrl-D keeps moving the prompt line up, erasing past commands and prompts.

Details:

  • If i call Input::interact_text instead, the prompt is not moved up one line, but the input is ignored. (Nothing happens, instead of the input being closed.)
  • Select::input does not have this behavior/bug.
alex19EP

alex19EP

p-select
Comment Icon8

to improve accessibility of select and multi select widgets a terminal cursor should be set at entries which currently highlighted with "❯".

this will greatly improve the usability of applications which depends on this library for blind people.

thank you.

Versions

Find the latest versions by id

Information - Updated Jun 15, 2022

Stars: 716
Forks: 95
Issues: 48

Rust library for Self Organising Maps (SOM)

Add rusticsom as a dependency in Cargo

Rust library for Self Organising Maps (SOM)

Rust library for parsing configuration files

The 'option' can be any string with no whitespace

Rust library for parsing configuration files

Rust library for the Pimoroni Four Letter pHAT

This library aims to port ht16k33 (or rather a fork, as of right now) so credit goes to ht16k33-diet

Rust library for the Pimoroni Four Letter pHAT

Rust library for emulating 32-bit RISC-V

This library can execute instructions against any memory and register file that implements

Rust library for emulating 32-bit RISC-V

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

You can use actix-web as a backend instead of hyper

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

This module provides two high level functions, getfacl and setfacl

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

enabling remote control support for embedded project

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

open up an issue on this repository and let us know

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

Rust library for parsing COLLADA files

Notice: This library is built around files exported from Blender 2

Rust library for parsing COLLADA files

Rust library for low-level abstraction of MIPS32 processors

This project is licensed under the terms of the MIT license

Rust library for low-level abstraction of MIPS32 processors
Facebook Instagram Twitter GitHub Dribbble
Privacy