Skip to content
\n

I use tmux on my main terminal (iterm2)
\ni was wondering if it was possible to use and split-pane as external terminal. i tried the following.

\n
dap.defaults.fallback.external_terminal = {\n    command = '/opt/homebrew/bin/tmux';\n    args = {'split-pane'};\n}\n
\n

this works for most projects but for java projects with a big classpath it fails
\ni get Terminal exited with status 1

\n

PS
\nthe project which has the huge classpath is a project from work. so i can't share much details on it. if anyone has any suggestions please share

","upvoteCount":1,"answerCount":4,"acceptedAnswer":{"@type":"Answer","text":"

thanks to @mfussenegger

\n
dap.configurations.configurations.java = {\n    {\n        ...\n        shortenCommandLine = \"argfile\",\n        ...\n    }\n}\n
\n

same can be use while running test cases. just add the config while calling the api
\nlua require'jdtls'.test_nearest_method({config = {shortenCommandLine=\"argfile\"}})

\n

one caveat. if your test cases are path dependent (my work project loads some json files into mongodb using relative paths). you will have to enusre that the \"terminal\" starts at the correct root directory for tmux i do

\n
dap.defaults.fallback.external_terminal = {\n\tcommand = \"tmux\",\n\targs = { \"split-pane\", \"-c\", \"<desired-root-dir>\"},\n}\n
","upvoteCount":4,"url":"https://github.com/mfussenegger/nvim-dap/discussions/656#discussioncomment-3455369"}}}

Use tmux pane/window for external terminal #656

Answered by Abh15h3k
Abh15h3k asked this question in Q&A
Discussion options

You must be logged in to vote

thanks to @mfussenegger

dap.configurations.configurations.java = {
    {
        ...
        shortenCommandLine = "argfile",
        ...
    }
}

same can be use while running test cases. just add the config while calling the api
lua require'jdtls'.test_nearest_method({config = {shortenCommandLine="argfile"}})

one caveat. if your test cases are path dependent (my work project loads some json files into mongodb using relative paths). you will have to enusre that the "terminal" starts at the correct root directory for tmux i do

dap.defaults.fallback.external_terminal = {
	command = "tmux",
	args = { "split-pane", "-c", "<desired-root-dir>"},
}

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@mfussenegger
Comment options

@Abh15h3k
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Abh15h3k
Comment options

You must be logged in to vote
1 reply
@Abh15h3k
Comment options

Comment options

You must be logged in to vote
1 reply
@AskaJohnny
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants