Skip to content

Unhandled carriage return as 'Enter' #176

@Carnicero90

Description

@Carnicero90

Laravel Prompts Version

0.3.2

Laravel Version

11.31.0

PHP Version

8.3.3

Operating System & Version

macOS 14.5

Terminal Application

alacritty, builtin vscode terminal, etc

Description

Whenever my terminal doesn't convert carriage return to new line (not sure why taht's happening, it seems to be caused by prompts though, for whatever reason), I am unable to submit any prompt, since \r isn't handled.

I think you could either add icrnl in Terminal@setTty or submit on $key == Key::CARRIAGE_RETURN as well, maybe?

I patched via
` public function setTty(string $mode): void
{
$this->initialTtyMode ??= $this->exec('stty -g');

 $this->exec("stty $mode icrnl"); }` 

in my repo, I'm not quite sure of all the implications of this approach though.

Steps To Reproduce

stty -icrnl
php artisan make:request
try to press enter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions