Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdin panics when onCommandCompletion event with colon suffixed command #601

Closed
lmorg opened this issue May 18, 2023 · 0 comments · Fixed by #599
Closed

stdin panics when onCommandCompletion event with colon suffixed command #601

lmorg opened this issue May 18, 2023 · 0 comments · Fixed by #599
Labels
bug Unexpected behavior

Comments

@lmorg
Copy link
Owner

lmorg commented May 18, 2023

Describe the bug:

dev » pacman: foo -f
Error in `pacman` (0,1): Not a valid expression:
                       >     unexpected symbol ':' (58)
                       >     Expression: pacman: foo -f
                       >               :       ^
                       >     Character : 6
                       > Nor a valid statement:
                       >     exec: "pacman": executable file not found in $PATH
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x1023bf48c]

goroutine 2306 [running]:
github.com/lmorg/murex/builtins/pipes/streams.(*Stdin).GetDataType(0x0)
        /Users/laurencemorgan/Documents/Documents - Laurence’s MacBook Pro/dev/go/src/github.com/lmorg/murex/builtins/pipes/streams/utils.go:41 +0x1c
github.com/lmorg/murex/builtins/core/pipe.cmdMurexNamedPipe(0x14000195df0)
        /Users/laurencemorgan/Documents/Documents - Laurence’s MacBook Pro/dev/go/src/github.com/lmorg/murex/builtins/core/pipe/namedpipe.go:46 +0x14c
github.com/lmorg/murex/lang.executeProcess(0x14000195df0)
        /Users/laurencemorgan/Documents/Documents - Laurence’s MacBook Pro/dev/go/src/github.com/lmorg/murex/lang/process.go:308 +0x804
created by github.com/lmorg/murex/lang.runModeNormal
        /Users/laurencemorgan/Documents/Documents - Laurence’s MacBook Pro/dev/go/src/github.com/lmorg/murex/lang/interpreter_pc.go:79 +0x48

This only happens when a command is using onCommandCompletion PTY

Expected behaviour:
shouldn't panic

@lmorg lmorg added the bug Unexpected behavior label May 18, 2023
@lmorg lmorg linked a pull request May 19, 2023 that will close this issue
@lmorg lmorg mentioned this issue May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant