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
When creating a prompt session and calling for prompts through the session's prompt method, prompt call-specific parameters can be passed to the method that can overwrite whatever parameters were passed to the session. However, this seems to overwrite the session parameters and not be scoped to that specific method call. Example:
importprompt_toolkitsession=prompt_toolkit.PromptSession()
session.prompt("(1) Enter single line input: ")
session.prompt("(2) Enter multiline input: ", multiline=True)
session.prompt("(3) Enter single line input again: ")
session.prompt("(4) Enter single line input once more: ", multiline=None)
The first and second prompt calls work as specified. However the third and fourth are still multiline inputs. I would expect that the third and fourth prompts be singleline inputs because they do not specify the multiline parameter. However it appears that the multiline parameter passed in the second prompt call is overwriting the session and causing the third and fourth to erroneously be multiline inputs despite them not specifying so at all. This isn't limited just to the multiline parameter it appears other parameters like bottom_toolbar suffer from this unusual behaviour as well.
Is this behaviour a bug or is it intentional? If it is intentional I would still propose changing it because of how unintuitive it is. Parameters should be limited per prompt call and should not affect or overwrite other prompt calls even for the same session.
Note: This behaviour also affects Session.prompt_async
The text was updated successfully, but these errors were encountered:
When creating a prompt session and calling for prompts through the session's
prompt
method, prompt call-specific parameters can be passed to the method that can overwrite whatever parameters were passed to the session. However, this seems to overwrite the session parameters and not be scoped to that specific method call. Example:The first and second prompt calls work as specified. However the third and fourth are still multiline inputs. I would expect that the third and fourth prompts be singleline inputs because they do not specify the multiline parameter. However it appears that the
multiline
parameter passed in the second prompt call is overwriting the session and causing the third and fourth to erroneously be multiline inputs despite them not specifying so at all. This isn't limited just to themultiline
parameter it appears other parameters likebottom_toolbar
suffer from this unusual behaviour as well.Is this behaviour a bug or is it intentional? If it is intentional I would still propose changing it because of how unintuitive it is. Parameters should be limited per prompt call and should not affect or overwrite other prompt calls even for the same session.
Note: This behaviour also affects
Session.prompt_async
The text was updated successfully, but these errors were encountered: