dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 191 forks source link

Interactive mode crashing #362

Closed ellbosch closed 4 years ago

ellbosch commented 4 years ago

mssql-cli is crashes from certain keystrokes or commands. The error returns Unhandled exception in event loop.

Repro:

Tests need to be introduced so we can catch this behavior in the future.

Full stack trace:

Unhandled exception in event loop:
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/eventloop/posix.py", line 154, in _run_task
    t()
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/eventloop/context.py", line 115, in new_func
    return func(*a, **kw)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 376, in redraw
    self._redraw()
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 444, in _redraw
    self.renderer.render(self, self.layout)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/renderer.py", line 546, in render
    layout.container.preferred_height(size.columns, size.rows).preferred)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 245, in preferred_height
    for c in self._all_children]
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 245, in <listcomp>
    for c in self._all_children]
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 639, in preferred_height
    return self.content.preferred_height(width, max_available_height)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 245, in preferred_height
    for c in self._all_children]
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 245, in <listcomp>
    for c in self._all_children]
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 2179, in preferred_height
    return self.content.preferred_height(width, max_available_height)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 1362, in preferred_height
    dont_extend=self.dont_extend_height())
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 1380, in _merge_dimensions
    preferred = get_preferred()
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/containers.py", line 1357, in preferred_content_height
    self.get_line_prefix)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/controls.py", line 561, in preferred_height
    height += content.get_height_for_line(i, width, get_line_prefix)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/layout/controls.py", line 186, in get_height_for_line
    get_line_prefix(lineno, height - 1))
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/shortcuts/prompt.py", line 807, in _get_line_prefix
    return self._get_continuation(prompt_width, line_number, wrap_count)
  File "/Users/ellbosch/Repos/mssql-cli/env37/lib/python3.7/site-packages/prompt_toolkit/shortcuts/prompt.py", line 783, in _get_continuation
    prompt_continuation = prompt_continuation(width, line_number, wrap_count)

Exception get_continuation() takes 1 positional argument but 3 were given
Press ENTER to continue...