Skip to content

Conversation

@afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Nov 30, 2025

Closes #4410

Also makes sure that shell checks the --tty flag

Could probably use some tests, this is code only

@AkihiroSuda AkihiroSuda added this to the v2.1.0 (?) milestone Dec 1, 2025
@AkihiroSuda AkihiroSuda modified the milestones: v2.1.0 (?), v2.0.3 Dec 16, 2025
The current UI library will crash, if trying to read
input from something that is not a terminal (a TTY).

Signed-off-by: Anders F Björklund <[email protected]>
Signed-off-by: Anders F Björklund <[email protected]>
@afbjorklund
Copy link
Member Author

Added a test, here are the results with the old code:

 ✗ lima stopped lima instance
   (in test file hack/bats/tests/shell.bats, line 20)
     `limactl shell --tty=false "$NAME" true </dev/null' failed
? Do you want to start the instance now?  (Y/n) time="2025-12-17T07:53:09+01:00" level=fatal msg=EOF
 ✗ yes | stopped lima instance
   (in test file hack/bats/tests/shell.bats, line 25)
     `bash -c "yes | limactl shell --tty=true $NAME true"' failed with status 2
? Do you want to start the instance now?  (Y/n) panic: runtime error: invalid memory address or nil pointer dereference
   [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xfa56f6]

Now the results are consistent, although confusing:

i.e. the yes is discarded (like --yes).

But at least it is not crashing anymore...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10fddebb6 (AlecAivazis/survey/v2/terminal.(*RuneReader).ReadLineWithDefault)

2 participants