Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to copy ConEmu.xml file to user-conemu.xml backup location! #1930

Closed
Geolle opened this issue Oct 29, 2018 · 6 comments
Closed

Comments

@Geolle
Copy link

Geolle commented Oct 29, 2018

When I use vs Code debug and set the terminal to cmder, I got this Error

Failed to copy ConEmu.xml file to user-conemu.xml backup location!

this is the configuration in vs Code

"terminal.external.windowsExec": "C:\Users\Smile_Gum_Gum\AppData\Local\cmder\Cmder.exe",

Can anybody help me out

@daxgames
Copy link
Member

daxgames commented Nov 3, 2018

@Geolle
Copy link
Author

Geolle commented Nov 7, 2018

@daxgames

No, I'm not saying using cmder in vscode, I'm talking about using cmder.exe for debug

svr g fwahjdem2 y p2n

@daxgames
Copy link
Member

daxgames commented Nov 7, 2018

Cmder.exe is a dumb launcher that does the file copy that is failing. init.bat does all the work.

I am not a VS Code user but many of our users are and this is how they integrate cmder, I assume for the same purpose you are trying to do.

@DRSDavidSoft can you look at this and confirm? It does not look the same but maybe you can make some recommendations.

@daxgames
Copy link
Member

daxgames commented Nov 7, 2018

@smgg I am not sure if the below would work but it looks to me like this might achieve what you want ASSUMING it is valid:

Note: Substitute [cmder_root] with your Cmder installation directory.

"terminal.external.windowsExec": "cmd.exe",
"terminal.external.windowsExecArgs": [
      "/k", "[cmder_root]\\vendor\\init.bat"
],

@DRSDavidSoft
Copy link
Contributor

@smgg & @daxgames – Sorry for the late response.

I'd like to clear some up some information on the way both Cmder and VS Code. Hopefully this can also be used a future reference for similar problems.

TL;DR: make sure you are on the latest version and also whether you get the same error message if you get the same error message when you launch the terminal directly (and not using the debug menu)


I decided to write a complete explanation on how Cmder and VS Code work internally for future references.

Cmder is a software package

A rather important thing to grasp on is that Cmder is not a stand-alone executable, but a collection of different software items that are packaged together in order to provide a complete terminal.

For the sake of simplicity, I break up the contents to the following:

  1. The console (terminal window)
  2. The internal shell

Whenever Cmder.exe is launched, a new console window is created and loaded with the Cmder shell.

This is the typical window you see when you double-click on the Cmder.exe binary:

Cmder is packaged with ConEmu as the console window, and uses clink with some special configuration as the default shell. The window you see in the above photo, is actually the packaged ConEmu that emulates the terminal in a window.

As @daxgames said, the Cmder.exe binary is just a launcher that opens the ConEmu with the Cmder shell. (The main core of Cmder is a batch file located at vendor/init.bat which provides the actual shell.)


How the terminal in VS Code works

There are actually two different modes that the VS Code terminal operates in:

  1. integrated: The terminal is rendered inside the VS Code's window – (a.k.a the "Seamless mode" here)
  2. external: VS Code launches an external terminal.

How do they differ?

  • In the first mode, the Cmder's shell (consisting of clink and all the other goodies) are ran inside a frame in the VS Code window, hence the name "integrated terminal". This is referred to as the "Seamless mode" in the Cmder wiki and guides. (The default hotkey is Ctrl + ~.)
  • As the opposite, the "external terminal" mode will simply launch a new terminal window. (The default hotkey is Ctrl + Shift + C.)

Here's a demo of the first mode:

Here's the relevant configuration for both methods:

    "terminal.integrated.shell.windows": "cmd.exe",
    "terminal.integrated.shellArgs.windows": [
        "/k", "%CMDER_ROOT%\\vendor\\init.bat"
    ],

    "terminal.external.windowsExec": "C:\\path\\to\\cmder\\Cmder.exe",

Now I'm not quite sure as to why @smgg would like to use the external window method instead of the integrated method, but the above configuration should work just fine in this case.

There are a couple things I need to mention:

  1. Make sure you're using the latest version of Cmder. The code for Cmder.exe launcher is always being updated, and your issue might be fixed if you update. How to see which version you are using?

  2. Test running Cmder as the external terminal without using the debug option. (Ctrl + Shift + C) You should not get the following message:

    Failed to copy ConEmu.xml file to user-conemu.xml backup location!

    • If you are getting this message without using the debug menu, there is something wrong with the launcher code that we need to fix.
    • If this error message only appears with the debug menu, we need to consider adding this as a new functionality.
  3. Always use the appropriate configuration for each method:

    • the integrated terminal method should only call the init.bat file to adjust the shell.
    • the external terminal should always call a terminal emulator (such as the ConEmu via Cmder.exe) to run.
  4. @daxgames, the "terminal.external.windowsExecArgs" thing that you suggested is not a valid VS Code settings option, and does not have any effect.

@daxgames
Copy link
Member

daxgames commented Dec 2, 2018

@DRSDavidSoft Thanks for the write-up. I am not a VSCode user so I was guessing. That is why I asked you to chime in since I know you could help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants