cmderdev / cmder

Lovely console emulator package for Windows
https://cmder.app
MIT License
25.74k stars 2.02k forks source link

IntelliJ terminal opens and crashes #2885

Closed DRSDavidSoft closed 9 months ago

DRSDavidSoft commented 9 months ago

@DRSDavidSoft Apologies for the late response. I took the logs. The terminal output the values in the file below and then just crashed. Therefore, I collected the output in a file. Seems there is no error output.

Awaiting your analysis. Thank you

systeminfo.txt

Originally posted by @alibutt30 in https://github.com/cmderdev/cmder/issues/282#issuecomment-1774590239

DRSDavidSoft commented 9 months ago

@alibutt30 Thanks for the log, can you please open this file:

C:\utils\cmder\config\user_profile.cmd 

Then modify the line @echo off to be echo on and generate the log using the /d flag again? Note: Please remember to change it back to @echo off once you're done. Thank you!

chrisant996 commented 9 months ago

@alibutt30 Can you also describe the crash? "Crash" can mean different things to different people, and readers are likely assuming various meanings that may or may not be similar to what you're experiencing.

Knowing more about what's happening can improve the troubleshooting process, and help identify a fix more quickly.

DRSDavidSoft commented 9 months ago

I believe he refers to the unexpected exit of the batch script

chrisant996 commented 9 months ago

What are the contents of user_profile.cmd?

It's a user-customizable script, right?

If it calls another batch script without using the call keyword, then it will halt further script processing.

alibutt30 commented 9 months ago

Apologies for the late reply.

Thank you for moving the topic to a separate conversation and issue.

The crash means the unexpected exit of the batch script. (uploading a small video to explain what i see)

https://github.com/cmderdev/cmder/assets/18707261/4ff57b1d-7084-4634-aa3e-58f3ea33a3ae

@DRSDavidSoft I enabled the echo on for this file as per your instructions

C:\utils\cmder\config\user_profile.cmd 

there is nothing inside the user_profile.cmd. (attaching it for you to see along with debug logs)

user_profile.txt debug_info.txt

The shell path i use in IntelliJ is as follows

C:\utils\cmder\vendor\bin\cmder_shell.cmd /d > C:\Users\XXX\Desktop\debug_info.txt

Thank you,

DRSDavidSoft commented 9 months ago

@alibutt30 I have updated the official guide with the correct approach to integrate Cmder into IntelliJ. Please visit this page and apply the required changes to the IntelliJ settings:

https://github.com/cmderdev/cmder/wiki/Seamless-IntelliJ-based-Integration

This should fix the problem for you completely.

If this didn't work, please let me know that whether in the user_profile.txt file that you attached, did you change the last line to echo on, as it still reads @echo off.

Furthermore, please open the following file in your local installation: [cmder_root]\vendor\bin\cmder_shell.cmd

then replace the content with the updated version that I have linked above, the difference is that I have added %* after this line: call "%CMDER_ROOT%\vendor\init.bat" /f

alibutt30 commented 9 months ago

@DRSDavidSoft Thank you so much for the fix. I can confirm that I provided you the logs with the @echo on and I accidentally gave you the file after reverting it back to @echo off

I updated the [[cmder_root]\vendor\bin\cmder_shell.cmd] file in my local installation. And then followed the https://github.com/cmderdev/cmder/wiki/Seamless-IntelliJ-based-Integration page to use the correct shell path in the terminal settings in IntelliJ.

I can confirm the changes indeed fix the issue.

Thank you so much for your support and the fast fix.