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

Ctrl+C - Disable terminate batch job question #1666

Closed
xelra opened this issue Feb 23, 2018 · 11 comments
Closed

Ctrl+C - Disable terminate batch job question #1666

xelra opened this issue Feb 23, 2018 · 11 comments

Comments

@xelra
Copy link

xelra commented Feb 23, 2018

One of the most annoying things when working with the Command Prompt on Windows is the Terminate batch job (Y/N)? question that has to be answered after pressing ctrl+c.
Some people are ok with pressing ctrl+c twice, but this doesn't always work.

Cmder brings the Unix workflow to Windows and a great feature would be to suppress this question.

There's a little project called CmdEx, which has exactly done that. Maybe the code could be mostly copied from that?

Thank you very much for considering.

@xelra xelra changed the title Ctrl+C - Disable terminate batch job Ctrl+C - Disable terminate batch job question Feb 23, 2018
@DRSDavidSoft
Copy link
Contributor

DRSDavidSoft commented Feb 23, 2018

Solution:

clink set terminate_autoanswer 1

or, read @edmundo096's answer: #1666 (comment)

Wiki page: https://github.com/cmderdev/cmder/wiki/Customization#terminate-batch-job-yn

👉 Note: Restart Cmder session to take effect.


@xelra Vote up for merging CmdEx into Cmder, alongside Clink!

@edmundo096
Copy link

This was somewhat previously commented on #1488

@edmundo096
Copy link

edmundo096 commented Feb 27, 2018

Also discussed here #108
Probably what samvasko pointed to on that issue, there is a setting inside \cmder\config\settings file:

# name: Auto-answer terminate prompt
# type: enum
#  0 = Disabled
#  1 = Answer 'Y'
#  2 = Answer 'N'
# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 =
# disabled, 1 = answer 'Y', 2 = answer 'N'.
terminate_autoanswer = 1

That should do the trick.

@DRSDavidSoft
Copy link
Contributor

DRSDavidSoft commented Mar 9, 2019

Thanks @edmundo096! I added your solution to our wiki:

@daxgames
Copy link
Member

just run:

C:\Users\user\Documents$ clink set terminate_autoanswer 1
Settings 'terminate_autoanswer' set to '1'

@seezmashele
Copy link

seezmashele commented Apr 5, 2021

Using
clink set terminate_autoanswer 1
Returns 'ERROR: Setting 'terminate_autoanswer' not found.' in my case

I used clink set cmd.auto_answer 1 which adds 'cmd.auto_answer = answer_yes' to clink_settings
Problem solved 🙂

@chrisant996
Copy link
Contributor

chrisant996 commented Apr 5, 2021

Using 'clink set terminate_autoanswer 1'
Returns 'ERROR: Setting 'terminate_autoanswer' not found.' in my case

That suggestion was given when Clink 0.4.9 was being used.
Since then, in newer versions of Clink the settings were overhauled and renamed.

I used 'clink set cmd.auto_answer 1' which adds 'cmd.auto_answer = answer_yes' to clink_settings
Problem solved 🙂

Yes, that's the new name.
Great to hear confirmation it's working as desired!

@chrisant996
Copy link
Contributor

For the record: I've also added backward compatibility with old setting names (except for a couple that have been removed). That should make it so old posts that e.g. mention clink set terminate_autoanswer will still work, and will just get redirected to the corresponding new setting(s).

@DRSDavidSoft
Copy link
Contributor

@chrisant996 Good idea, could you please also link the commit you made that enables this?

@chrisant996
Copy link
Contributor

@chrisant996 Good idea, could you please also link the commit you made that enables this?

I've linked it in the Clink repo and in the Clink documentation. Please feel free to link it here yourself if that seems desirable. That would be a nice way to help me out, so that I'm not single handedly doing all the things that are requested. I only have so much time.

(Yes it took me longer to write that than it would have to find the change and link it. But I'm setting boundaries, so it's worth it.)

@DRSDavidSoft
Copy link
Contributor

@chrisant996 No worries, and thanks for all the wonderful work you're doing on Clink! I'm afraid I wasn't able to find the commit that made this change at that time either in the Clink.md documentation, or in Commits history, hence the request.

However, upon further search, I found it at chrisant996/clink@b7ccf59, so I'd like to apologize for my request, and thank you for the time.

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

6 participants