puremourning / vimspector

vimspector - A multi-language debugging system for Vim
http://puremourning.github.io/vimspector-web
Apache License 2.0
4.1k stars 173 forks source link

Wrong window size in neovim #255

Closed black-desk closed 4 years ago

black-desk commented 4 years ago

DO NOT DELETE THIS TEMPLATE. IF YOU DELETE THIS TEMPLATE AND DO NOT COMPLETE IT, YOUR ISSUE WILL BE CLOSED.

Describe the bug

Provide a clear and concise description of what the bug is. image in neovim, as the picture above, the size of the output and console window seem to be wrong but in vim, it works fine: image

it seems to have something to do with the winbar which doesn't show in the neovim side.

this is not just a looking issue, it seems the last line of console window is under the status bar, it make me cannot see what I typing. and when i press the ctrl+l strange things will happen.

asciicast

Minimal reproduciton

Please answer the following questions

  1. Run vim -Nu /path/to/vimspector/support/minimal_vimrc
  2. Open '/path/to/vimspector/tests/testdata/cpp/simple/simple.cpp'
  3. Press
  4. Enter gdb for VIMSPECTOR_MIMODE

Use the following Vimspector config file:

/path/to/vimspector/tests/testdata/cpp/simple/.vimspector.json

Expected behaviour

just behave as vim, but without winbar

Actual behaviour

the size of output window and the console window is wrong

Please include:

  • Vimspector log (~/.vimspector.log)

2020-09-11 21:22:05,672 - INFO - INITIALISING NEW VIMSPECTOR SESSION 2020-09-11 21:22:05,672 - INFO - API is: neo 2020-09-11 21:22:05,673 - INFO - VIMSPECTOR_HOME = /home/black_desk/.vim/plugged/vimspector 2020-09-11 21:22:05,677 - INFO - gadgetDir = /home/black_desk/.vim/plugged/vimspector/gadgets/linux 2020-09-11 21:22:05,682 - INFO - User requested start debug session with {} 2020-09-11 21:22:05,683 - DEBUG - Reading gadget config: /home/black_desk/.vim/plugged/vimspector/gadgets/linux/.gadgets.json 2020-09-11 21:22:05,685 - DEBUG - Reading gadget config: None 2020-09-11 21:22:05,685 - DEBUG - Reading configurations from: None 2020-09-11 21:22:05,685 - DEBUG - Reading configurations from: /home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple/.vimspector.json 2020-09-11 21:22:07,591 - DEBUG - Value for VIMSPECTOR_MIMODE not set in ${VIMSPECTOR_MIMODE} (from ${VIMSPECTOR_MIMODE}): set to gdb 2020-09-11 21:22:07,592 - INFO - Configuration: {"adapter": "vscode-cpptools", "default": true, "configuration": {"request": "launch", "program": "/home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple/simple", "externalConsole": false, "stopAtEntry": true, "stopOnEntry": true, "MImode": "gdb"}, "breakpoints": {"exception": {"cpp_catch": "", "cpp_throw": "", "objc_catch": "", "objc_throw": "", "swift_catch": "", "swift_throw": ""}}} 2020-09-11 21:22:07,592 - INFO - Adapter: {"attach": {"pidProperty": "processId", "pidSelect": "ask"}, "command": ["/home/black_desk/.vim/plugged/vimspector/gadgets/linux/vscode-cpptools/debugAdapters/OpenDebugAD7"], "configuration": {"args": [], "cwd": "/home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple", "environment": [], "type": "cppdbg"}, "name": "cppdbg"} 2020-09-11 21:22:07,702 - INFO - Starting debug adapter with: {"attach": {"pidProperty": "processId", "pidSelect": "ask"}, "command": ["/home/black_desk/.vim/plugged/vimspector/gadgets/linux/vscode-cpptools/debugAdapters/OpenDebugAD7"], "configuration": {"args": [], "cwd": "/home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple", "environment": [], "type": "cppdbg"}, "name": "cppdbg"} 2020-09-11 21:22:07,706 - INFO - Debug Adapter Started 2020-09-11 21:22:07,707 - DEBUG - Sending Message: {"command": "initialize", "arguments": {"adapterID": "cppdbg", "clientID": "vimspector", "clientName": "vimspector", "linesStartAt1": true, "columnsStartAt1": true, "locale": "en_GB", "pathFormat": "path", "supportsVariableType": true, "supportsVariablePaging": false, "supportsRunInTerminalRequest": true}, "seq": 0, "type": "request"} 2020-09-11 21:22:07,818 - INFO - Server stderr: waiting for v8 protocol on stdin/stdout

2020-09-11 21:22:08,582 - DEBUG - Message received: {'type': 'response', 'request_seq': 0, 'success': True, 'command': 'initialize', 'body': {'supportsConfigurationDoneRequest': True, 'supportsFunctionBreakpoints': True, 'supportsConditionalBreakpoints': True, 'supportsEvaluateForHovers': True, 'exceptionBreakpointFilters': [], 'supportsSetVariable': True, 'additionalModuleColumns': [], 'supportedChecksumAlgorithms': []}, 'seq': 1} 2020-09-11 21:22:08,582 - DEBUG - LAUNCH! 2020-09-11 21:22:08,584 - DEBUG - Sending Message: {"command": "launch", "arguments": {"args": [], "cwd": "/home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple", "environment": [], "type": "cppdbg", "request": "launch", "program": "/home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple/simple", "externalConsole": false, "stopAtEntry": true, "stopOnEntry": true, "MImode": "gdb", "name": "test"}, "seq": 1, "type": "request"} 2020-09-11 21:22:08,774 - DEBUG - Message received: {'type': 'request', 'command': 'runInTerminal', 'arguments': {'kind': 'integrated', 'title': 'cppdbg: simple', 'cwd': '', 'args': ['/bin/sh', '/tmp/Microsoft-MIEngine-Cmd-cmudsjoz.ukc'], 'env': {}}, 'seq': 2} 2020-09-11 21:22:08,774 - DEBUG - Defaulting working directory to /home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple 2020-09-11 21:22:08,790 - DEBUG - Sending Message: {"seq": 2, "type": "response", "request_seq": 2, "command": "runInTerminal", "body": {"processId": 19980}, "success": true} 2020-09-11 21:22:08,927 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'telemetry', 'output': 'VS/Diagnostics/Debugger/Launch', 'data': {'VS.Diagnostics.Debugger.ImplementationName': 'Microsoft.MIDebugEngine', 'VS.Diagnostics.Debugger.EngineVersion': '16.5.10325.1', 'VS.Diagnostics.Debugger.HostVersion': '16.5.10325.1', 'VS.Diagnostics.Debugger.AdapterId': 'cppdbg', 'VS.Diagnostics.Debugger.Launch.Duration': 313, 'VS.Diagnostics.Debugger.Launch.IsCoreDump': False, 'VS.Diagnostics.Debugger.VisualizerFileUsed': False, 'VS.Diagnostics.Debugger.SourceFileMappings': 0, 'VS.Diagnostics.Debugger.MIMode': None}}, 'seq': 3} 2020-09-11 21:22:08,944 - DEBUG - Message received: {'type': 'response', 'request_seq': 1, 'success': True, 'command': 'launch', 'body': {}, 'seq': 4} 2020-09-11 21:22:08,945 - DEBUG - Message received: {'type': 'event', 'event': 'initialized', 'body': {}, 'seq': 5} 2020-09-11 21:22:08,945 - DEBUG - Sending Message: {"command": "setFunctionBreakpoints", "arguments": {"breakpoints": []}, "seq": 3, "type": "request"} 2020-09-11 21:22:09,010 - DEBUG - Message received: {'type': 'response', 'request_seq': 3, 'success': True, 'command': 'setFunctionBreakpoints', 'body': {'breakpoints': []}, 'seq': 6} 2020-09-11 21:22:09,011 - DEBUG - Breakpoints at this point: {} 2020-09-11 21:22:09,012 - DEBUG - Sending Message: {"command": "configurationDone", "seq": 4, "type": "request"} 2020-09-11 21:22:09,019 - DEBUG - Message received: {'type': 'response', 'request_seq': 4, 'success': True, 'command': 'configurationDone', 'body': {}, 'seq': 7} 2020-09-11 21:22:09,020 - DEBUG - Sending Message: {"command": "threads", "seq": 5, "type": "request"} 2020-09-11 21:22:09,024 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'stdout', 'output': '=thread-group-added,id="i1"\nGNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git\nCopyright (C) 2018 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\nThis GDB was configured as "x86_64-linux-gnu".\nType "show configuration" for configuration details.\nFor bug reporting instructions, please see:\nhttp://www.gnu.org/software/gdb/bugs/.\nFind the GDB manual and other documentation resources online at:\nhttp://www.gnu.org/software/gdb/documentation/.\nFor help, type "help".\nType "apropos word" to search for commands related to "word".\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n=cmd-param-changed,param="pagination",value="off"\n'}, 'seq': 8} 2020-09-11 21:22:09,063 - DEBUG - Message received: {'type': 'response', 'request_seq': 5, 'success': True, 'command': 'threads', 'body': {'threads': []}, 'seq': 9} 2020-09-11 21:22:09,064 - WARNING - User Msg: Server returned no threads. Is it running? 2020-09-11 21:22:10,366 - DEBUG - Message received: {'type': 'event', 'event': 'thread', 'body': {'reason': 'started', 'threadId': 19991}, 'seq': 10} 2020-09-11 21:22:10,367 - DEBUG - Sending Message: {"command": "threads", "seq": 6, "type": "request"} 2020-09-11 21:22:10,370 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'stdout', 'output': 'Stopped due to shared library event (no libraries added or removed)\n'}, 'seq': 11} 2020-09-11 21:22:10,381 - DEBUG - Message received: {'type': 'response', 'request_seq': 6, 'success': True, 'command': 'threads', 'body': {'threads': [{'id': 19991, 'name': 'simple'}]}, 'seq': 12} 2020-09-11 21:22:10,382 - DEBUG - Sending Message: {"command": "stackTrace", "arguments": {"threadId": 19991}, "seq": 7, "type": "request"} 2020-09-11 21:22:10,404 - DEBUG - Message received: {'type': 'response', 'request_seq': 7, 'success': True, 'command': 'stackTrace', 'body': {'stackFrames': [], 'totalFrames': 0}, 'seq': 13} 2020-09-11 21:22:11,550 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'console', 'output': "Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.\n"}, 'seq': 14} 2020-09-11 21:22:11,947 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'stdout', 'output': '\n'}, 'seq': 15} 2020-09-11 21:22:11,957 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'stdout', 'output': 'Breakpoint 1, main (argc=1) at simple.cpp:15\n'}, 'seq': 16} 2020-09-11 21:22:11,969 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'stdout', 'output': '15\t printf( "this is a test %d\n", argc );\n'}, 'seq': 17} 2020-09-11 21:22:11,988 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'console', 'output': "Loaded '/usr/lib/x86_64-linux-gnu/libstdc++.so.6'. Symbols loaded.\n"}, 'seq': 18} 2020-09-11 21:22:12,000 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'console', 'output': "Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.\n"}, 'seq': 19} 2020-09-11 21:22:12,016 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'console', 'output': "Loaded '/lib/x86_64-linux-gnu/libm.so.6'. Symbols loaded.\n"}, 'seq': 20} 2020-09-11 21:22:12,055 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'console', 'output': "Loaded '/lib/x86_64-linux-gnu/libgcc_s.so.1'. Symbols loaded.\n"}, 'seq': 21} 2020-09-11 21:22:12,071 - DEBUG - Message received: {'type': 'event', 'event': 'output', 'body': {'category': 'console', 'output': 'Execute debugger commands using "-exec ", for example "-exec info registers" will list registers in use (when GDB is the debugger)\n'}, 'seq': 22} 2020-09-11 21:22:12,105 - DEBUG - Message received: {'type': 'event', 'event': 'stopped', 'body': {'reason': 'step', 'threadId': 19991, 'allThreadsStopped': True, 'source': {'name': 'simple.cpp', 'path': '/home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple/simple.cpp', 'sources': [], 'checksums': []}, 'line': 15, 'column': 1}, 'seq': 23} 2020-09-11 21:22:12,105 - WARNING - User Msg: Paused in thread 19991 due to step 2020-09-11 21:22:12,121 - DEBUG - Sending Message: {"command": "stackTrace", "arguments": {"threadId": 19991}, "seq": 8, "type": "request"} 2020-09-11 21:22:12,152 - DEBUG - Message received: {'type': 'response', 'request_seq': 8, 'success': True, 'command': 'stackTrace', 'body': {'stackFrames': [{'id': 1000, 'name': 'main(int argc)', 'source': {'name': 'simple.cpp', 'path': '/home/black_desk/.vim/plugged/vimspector/tests/testdata/cpp/simple/simple.cpp', 'sources': [], 'checksums': []}, 'line': 15, 'column': 1}], 'totalFrames': 1}, 'seq': 24} 2020-09-11 21:22:12,172 - DEBUG - Sending Message: {"command": "scopes", "arguments": {"frameId": 1000}, "seq": 9, "type": "request"} 2020-09-11 21:22:12,223 - DEBUG - Message received: {'type': 'response', 'request_seq': 9, 'success': True, 'command': 'scopes', 'body': {'scopes': [{'name': 'Locals', 'variablesReference': 1000, 'expensive': False}]}, 'seq': 25} 2020-09-11 21:22:12,224 - DEBUG - Sending Message: {"command": "variables", "arguments": {"variablesReference": 1000}, "seq": 10, "type": "request"} 2020-09-11 21:22:12,269 - DEBUG - Message received: {'type': 'response', 'request_seq': 10, 'success': True, 'command': 'variables', 'body': {'variables': [{'name': 'argc', 'value': '1', 'type': 'int', 'evaluateName': 'argc', 'variablesReference': 0}]}, 'seq': 26}

Environemnt

NOTE: NeoVim is supported only on a best-effort basis. Please check the README for limitations of neovim. Don't be offended if I ask you to reproduce issues in Vim.

NOTE: Windows support is experimental and best-efrort only. If you find an issue related to Windows or windows-isms, consider sending a PR or discussing on Gitter rather than raising an issue.

git rev-parse HEAD
f1cc01a39950d18310bad2d14d7f8e7c52a1e7d0

nvim --version
NVIM v0.5.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-84GGzY/neovim-0.5.0+ubuntu2+git202009102032-7ba28b1ae-d569569c9=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORT
IFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -f
stack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-84
GGzY/neovim-0.5.0+ubuntu2+git202009102032-7ba28b1ae-d569569c9/build/config -I/build/neovim-84GGzY/neovim-0.5.0+ubuntu2+git202009102032-7ba28b1ae-d569569c9/src -I/build/neovim-84GGzY/neovim-0.5.0+u
buntu2+git202009102032-7ba28b1ae-d569569c9/.deps/usr/include -I/usr/include -I/build/neovim-84GGzY/neovim-0.5.0+ubuntu2+git202009102032-7ba28b1ae-d569569c9/build/src/nvim/auto -I/build/neovim-84GG
zY/neovim-0.5.0+ubuntu2+git202009102032-7ba28b1ae-d569569c9/build/include
Compiled by buildd@lgw01-amd64-048

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
which nvim
/usr/bin/nvim
3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0]
null
null
health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: RelWithDebInfo

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

## tmux
  - OK: escape-time: 10
  - INFO: Checking stuff
  - OK: focus-events: on
  - INFO: $TERM: screen-256color

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: tmux

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /home/black_desk/.tools/miniconda3/bin/python is Python 3.8 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3.6 in the environment.
  - INFO: Executable: /usr/bin/python3.6
  - INFO: Python version: 3.6.9
  - INFO: pynvim version: 0.4.1
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v12.18.3
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

wsl2 win10

Declaration

Please complete the following declaration. If this declaration is not completed, your issue may be closed without comment.

Yes

Additional information

Add any other context about the problem here.

nothing

puremourning commented 4 years ago

This is clearly a Neovim bug.

puremourning commented 4 years ago

does it happen with Neovim 0.4 (i.e. the latest release ) ?

puremourning commented 4 years ago

I can't repro this with Neovim 0.4, and I can repro with Neovim master.

I know at least one other user reported this, so I think this needs to be raised with the Neovim devs, but minimising a repro case is likely to be time consuming and difficult. I don't really have the bandwidth for that right now.

paging @bfredl who I just know will want to fix this.

I actually suspect this is due to the use of prompt buffers which are new in Neovim master and not used in Neovim 0.4

puremourning commented 4 years ago

steps to repro:

bfredl commented 4 years ago

If this is still an issue in neovim master, please ping me again. @puremourning

puremourning commented 4 years ago

@bfredl ping :)

I repro'd with master as of today.

black-desk commented 4 years ago

does it happen with Neovim 0.4 (i.e. the latest release ) ?

get back to 0.4 make the window work well, thanks

black-desk commented 4 years ago

@bfredl ping :)

I repro'd with master as of today.

me too

fratajczak commented 4 years ago

I bisected the problem to https://github.com/neovim/neovim/commit/9758f5e5087a046fe8b624a3e64bdae020bbfe99

puremourning commented 4 years ago

Closing as neovim bug. Please feel free to nag @bfredl and/or raise a minimal repro case in the neovim repo.