laravel / prompts

Beautiful and user-friendly forms for your command-line PHP applications.

Home Page:https://laravel.com/docs/prompts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Long options break `multisearch` options

joachim-n opened this issue · comments

Laravel Prompts Version

0.1.15

Laravel Version

N/A

PHP Version

8.1.23

Operating System & Version

MacOS

Terminal Application

iTerm2

Description

If one of the options passed to search() is longer than the size of the displayed box, the output looks broken, and using the up and down arrows makes the whole thing go haywire.

Partial output (EDIT - that doesn't show the problem as it doesn't wrap on here!)

 ┌ Enter the Event names ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
 │                                                                                                                                  │
 ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
 │   ◻ -- None --                                                                                                               ┃   │
 │   ◻ \Drupal\block_content\BlockContentEvents::BLOCK_CONTENT_GET_DEPENDENCY - \Drupal\block_content\BlockContentEvents::BLOCK_… │ │
 │   ◻ \Drupal\user\Event\UserEvents::FLOOD_BLOCKED_USER - \Drupal\user\Event\UserEvents::FLOOD_BLOCKED_USER                    │   │
 │   ◻ \Drupal\user\Event\UserEvents::FLOOD_BLOCKED_IP - \Drupal\user\Event\UserEvents::FLOOD_BLOCKED_IP                        │   │

Steps To Reproduce

Supply an option which is longer than the width of the terminal.

Hey @joachim-n,

I assume you mean the multisearch prompt? I'll take a look at that one, but couldn't replicate it with search.

The multisearch prompt should be fixed in #114. Let us know if you were actually experiencing the issue with the search prompt.

Yes, it was multisearch -- sorry for the mistake.
I've just tested with search() and it truncates long options with an ellipsis.
Thanks for the quick fix!