You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Close the file descriptor when the function returns.
Current Behavior and Steps to Reproduce
Each call to prompt.Input creates a New Prompt with NewStandardInputParser, which, for posix OS calls syscall.Open on "/dev/tty". The opened file descriptor is never closed, which causes a resource leak.
Context
I want to manage the input loop myself, but each time I call prompt.Input, it leaks another file descriptor. I found a workaround by creating a New Prompt and using its Input method, but I need to define a dummy executor that does nothing, just so I can call the New function.
Operating System: MacOS 12.3
Terminal Emulator: iTerm2
tag of go-prompt or commit revision: 0.2.6
The text was updated successfully, but these errors were encountered:
Bug reports
prompt.Input
leaks file descriptor of "/dev/tty"Expected Behavior
Close the file descriptor when the function returns.
Current Behavior and Steps to Reproduce
Each call to
prompt.Input
creates a NewPrompt
withNewStandardInputParser
, which, for posix OS callssyscall.Open
on "/dev/tty". The opened file descriptor is never closed, which causes a resource leak.Context
I want to manage the input loop myself, but each time I call
prompt.Input
, it leaks another file descriptor. I found a workaround by creating a New Prompt and using its Input method, but I need to define a dummy executor that does nothing, just so I can call theNew
function.The text was updated successfully, but these errors were encountered: