Python Forum
how to put history=0 in command prompt - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Bar (https://python-forum.io/forum-27.html)
+--- Thread: how to put history=0 in command prompt (/thread-10492.html)

Pages: 1 2


how to put history=0 in command prompt - sylas - May-23-2018

Hi all! I have about 100 commands possible in command prompt. Most of them are repeated. "history" alone shows these possible commands. But impossible to delete them. Here my error messages;
Error:
C:\Users\Sylvain λ reset history 1 [main] reset 8760 cygwin_exception::open_stackdumpfile: Dumping stack trace to reset.exe.stackdump C:\Users\Sylvain λ set history Environment variable history not defined C:\Users\Sylvain λ history=0 'history' is not recognized as an internal or external command, operable program or batch file. C:\Users\Sylvain λ set history Environment variable history not defined C:\Users\Sylvain λ history=0 'history' is not recognized as an internal or external command, operable program or batch file.



RE: how to put history=0 in command prompt - buran - May-23-2018

Sylas, please post in the correct subforum! This has nothing to do with python to be in the General Coding Help subforum... or even better - ask in the correct forum: https://www.google.com/search?q=windows+help+forum


RE: how to put history=0 in command prompt - sylas - May-23-2018

@buran
Do you think I will ever have a reply in this Bar forum ? I don't think so. Who looks at this Bar forum ?


RE: how to put history=0 in command prompt - buran - May-23-2018

This is python related forum and this is off-topic question. I would expect that if someone know the answer, they will help. If you are not satisfied, you can ask on windows-related forum.


RE: how to put history=0 in command prompt - wavic - May-23-2018

Try history -c.
Cygwin right? The bash command to clear the history is history -c


RE: how to put history=0 in command prompt - sylas - May-23-2018

@wavic
Thanks for your reply. I tried it on my "C:\Users\Sylvain". It does not work. I think there is a question of "Administrator". But I don't know how to become Administrator once I am on my Command Prompt.


RE: how to put history=0 in command prompt - buran - May-23-2018

I don't think you can elevate priviliges once cmd is open. You can either right-click cmd.exe and select Run as administrator OR press windows key+R, then enter cmd in the run window that will open and press cntrl+shift+enter


RE: how to put history=0 in command prompt - sylas - May-23-2018

Thanks to Buran. I tried your 2d proposal. It works fine. At the top of my command prompt ihave: C:\WINDOWS\system32\cmd.exe

And inside I have:

Microsoft Windows [Version 10.0.17134.48]
© 2018 Microsoft Corporation. All rights reserved.

C:\Users\Sylvain>set history
Environment variable history not defined

C:\Users\Sylvain>history=10
'history' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Sylvain>set history=10

C:\Users\Sylvain>history
'history' is not recognized as an internal or external command,
operable program or batch file.


RE: how to put history=0 in command prompt - wavic - May-23-2018

Hm! I don't remember if the cygwin has .bashrc file. Try to find it. See this: https://www.cygwin.com/cygwin-ug-net/setup-files.html
Put at the end of file on a new line this: HISTSIZE=0
Save the file and run cygwin again.


RE: how to put history=0 in command prompt - sylas - May-24-2018

@wavic
With a double right click on lambda(on the pinned icons at the bottom of the screen)my lambda is transformed; Now I am sure I am Administrator. The new command prompt accepts "set history=10", but does not accept "HISTSIZE=10". I am not strong in python, so I don't understand your "cygwin". I went to your link.
Error:
C:\Users\Sylvain λ HISTSIZE=10 'HISTSIZE' is not recognized as an internal or external command, operable program or batch file.

How is it possible you two big members of the staff, cannot solve this problem: put history = 10 ? With linux, no problem. Please go to this lambda icone, right click twice, become administrator and tell me if you can limit the possible commands, to ten. Thanks