Closed allstdcpp closed 1 year ago
I do not get this error, can you kindly test your project/setup with a previous commit (where it was successful) and update this?
lazy.nvim example:
{
'Civitasv/cmake-tools.nvim',
commit = "...",
}
Maybe going back in reverse to a commit that works can reveal the bug.
Works in commit 98ea713. This seems to be broken after the "Multi Terminals and Persistent Buffers" work.
Is there a error? Use :messages
to see.
I still could not get an error running with your config.
Seems like the keymap for <leader>cr
might not require vim.cmd.CMakeOpen()
. Can you try it without that?
... with just :CMakeRun
Getting the same issue, I have my <leader>cr
keymap assigned to <cmd>CMakeRun<cr>
and the executable isn't launching. @Civitasv I did take a look at :messages
but it doesn't show any errors there.
I did take a look at
:messages
but it doesn't show any errors there.
Weird, I wonder if it works if you type :CMakeRun
directly?
Just tried typing the command directly and it does the same thing as the key binding. The target that's supposed to launch is a macOS desktop app, once the build finishes the terminal does this:
❯ cd (main build folder)/Debug/AudioPluginHost.app/Contents/MacOS &&
cmdand>
But the app doesn't launch.
Maybe it’s an os specific problem. I will check today.
Yes, seems like an os specific problem. I think when we do a nvim_chan_send() to the terminal, it does not register the return character.
I had a simialr issue with sending the enter key in windows. In linux, '\n' emulated the enter key, but in windows, i had to explicitly concatenate a string.char(13) which emulated the Enter key on windows.
Perhaps Mac has this problem as well.
I tried running this directly with :CMakeRun on the current head and it still does not work.
Also nothing shows under :messages
I'm having the same issue under macOS Ventura 13.3.1. Looks like it is a problem specific to mac.
Just tried typing the command directly and it does the same thing as the key binding. The target that's supposed to launch is a macOS desktop app, once the build finishes the terminal does this:
❯ cd (main build folder)/Debug/AudioPluginHost.app/Contents/MacOS && cmdand>
But the app doesn't launch.
It gives the exact same output for me. However, if I type ./ExecName immediately afterwards, the executable is run. Is it intended to work like that?
Is it intended to work like that?
No, it’s not intended. So there is no ./ExecName at end of the command?
The latest commit should solve this problem, try it. @STZRoland
The latest commit should solve this problem, try it. @STZRoland
Yes it works now, you are a legend!!
Bug description I have just upgrade to the latest version and CMakeRun no longer executes the compiled binary I have been using a simple CMakeLists file which use to work.
cmake_minimum_required(VERSION 3.26) project(avl-tree)
set(CMAKE_CXX_STANDARD 20)
add_executable(avl-tree main.cpp) target_link_libraries(avl-tree PRIVATE -fsanitize=undefined,address) target_compile_options(avl-tree PRIVATE -fsanitize=undefined,address)
I also have a very simple cmake.lua plugin which has also worked before some recent changes in this project.
local M = {}
M.plugin = { "Civitasv/cmake-tools.nvim", config = function() local cmake = require("cmake-tools") cmake.setup({ cmake_command = "cmake", cmake_build_directory = "", cmake_build_directory_prefix = "cmakebuild", cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" }, cmake_generate_on_save = false, cmake_build_options = {}, cmake_console_size = 10, cmake_show_console = true, cmake_variants_message = { short = { show = true }, long = { show = true, max_length = 40 }, }, cmake_quickfix_opts = { show = "always", position = "belowright", size = 10, }, })
} return M
When you run now a window opens with the following:
cd /usr/home/xxxx/projects/cpp/avl-tree/cmake_build_Debug &&
an the program no longer runs and outputs in this window.
Hope this helps.
Blair