git-cheetah modifying path environment variable multiple times - windows

Just wanna find out if anyone has had a similar experience to this.
Git seems to be modifying my path environment variable, hereafter referred to as $path, such that if after having my system running for a few days the $path is 1 huge mess!
After a clean boot $path looks something like this:
D:\WINDOWS\system32;D:\WINDOWS;D:\Apps\Development\Git\cmd;D:\Apps\Development\Android\android-sdk\platform-tools;D:\Apps\Development\phantomjs-1.9.7-windows;D:\Apps\Tools\GnuWin32\bin
When it gets to the state I mentioned it looks something like this:
D:\Apps\Development\Git\git-cheetah..\bin;D:\WINDOWS\system32;D:\WINDOWS;D:\Apps\Development\Git\cmd;D:\Apps\Development\Android\android-sdk\platform-tools;D:\Apps\Development\phantomjs-1.9.7-windows;D:\Apps\Tools\GnuWin32\bin
Except that the D:\Apps\Development\Git\git-cheetah..\bin bit is repeated, sometimes (what looks like) over 50 times!
Any insight into this would be much appreciated

First of all, apologies that this is more of a workaround than an answer. I am experiencing the same exact issue. Eventually my PATH gets so large that my programs can't find anything, even as simple as XCOPY.
This is happening to me on my work computer which is under domain control and I don't have admin permissions. These instructions assume no admin access, strictly user access.
In order to avoid restarting I perform the following:
Prior to performing these steps you can open command window and run set PATH to verify that you have too many cheetahs.
Go to the Environment Variables dialog (Right-Click "My Computer" -> Choose "Properties" -> Select the "Advanced" tab -> Click the "Environment Variables" button).
Select "PATH" variable under the "User variables for <username>" section.
Click then "Edit" button under the same section.
Do nothing
Click OK in the "Edit User Variable" dialog box.
Click OK in the "Environment Variables" dialog box.
Click OK in the "System Properties" window.
Open a NEW command window (command windows that were already open may preserve their current environment) and run 'set PATH' to verify that you're back to none or one 'cheetah's in your path.

I had the same annoying problem. Just download git-cheetah source, open common/winexec.c and on line 262 change from:
if (path.len) {
setenv("PATH", path.buf, 1);
rec->envpath = strbuf_detach(&path, NULL);
}
to:
if (path.len) {
if (!strstr(getenv("PATH"), gitpath))
setenv("PATH", path.buf, 1);
rec->envpath = strbuf_detach(&path, NULL);
}
Then, recompile (cd explorer, mingw32-make) and copy the generated dll over the existing one in Program files\Git\git-cheetah. If the file is in use you can open a console window, close the Explorer process and copy using command line; then, restart explorer using the task manager (File->Execute).

Related

How to use a specific command in all directories?

Note: I am sorry if I posted this in the wrong stack exchange website. I have seen similar questions on this website. Please correct me if it was wrong.
So I installed VLC into the directory D:\misc\vlc and when I type "vlc" into command prompt, it starts the VLC media player. However, I want to run this "vlc" command in the directory D:\slam\ . However, every time I do that, it says that "'vlc' is not recognized as an internal or external command,
operable program or batch file.".
Is there a way to run the 'vlc' command in any directory?
Any help is appreciated.
You can add the vlc program to the PATH in Windows using the "Edit Environment Variables" dialog. Assuming Windows 10 (though this dialog is present in older versions too), here is how to add a program to the PATH:
Open the Start Search, type in “env”, and choose “Edit the system environment variables”
Click the “Environment Variables…” button.
Under the “System Variables” section (the lower half), find the row with “Path” in the first column, and click edit.
The “Edit environment variable” UI will appear. Here, you can click “New” and type in the new path you want to add. From this screen you can also edit or reorder them.
Dismiss all of the dialogs by choosing “OK”.
Your changes are saved! You will probably need to restart apps for them to pick up the change. Restarting the machine would ensure all apps are run with the PATH change.
In step 4 above, the new path that you will type is the directory containing the vlc program, e.g. "D:\misc". Note that adding this directory will also make any other programs inside of the "misc" directory accessible as well.

Disable "The last time you opened *, it unexpectedly quit while reopening windows" dialog in OSX 10.8

I managed to successfully silence the CrashReport dialog, but when my application crashes and I restart it, I get the annoying dialog as from Title. Is there a way to prevent it to appear, and just let the application run without interruption?
Try this to get rid of the reopening windows:
defaults write -app "Application Name" NSQuitAlwaysKeepsWindows -bool false
You may also disable it for every application by selecting this option in the preferences: "Close windows when quitting an application"
And for others reading this thread, to remove the CrashReport do this:
defaults write com.apple.CrashReporter DialogType none
Also note that in the source of this information they say:
For this to work one needs to check the box, open the program in
question and immediately close it. On the next re-opening it will work
without Resume.
You may also have to delete:
/Users/…/Library/Saved\ Application\ State/org.python.python.savedState/
I was having a similar problem with google chrome and I could solve it by reading the following link:
https://support.google.com/chrome/thread/22716083?hl=en
Drew Z recommends the following solution there which worked for me:
In the Mac menu bar at the top of the screen, click Go.
Select Go to Folder.
Enter ~/Library/Application Support/Google/Chrome/ in the text field, then press Go.
Locate the folder called "Default" in the directory window that opens and rename it as "Backup default."
Try opening Google Chrome again. A new "Default" folder is automatically created as you start using the browser.
Voila! I've just solved this problem by deleting all Unity-related files inside ~Library/Caches folder on my Mac!
For those trying to accomplish this
defaults write -app "Application Name" NSQuitAlwaysKeepsWindows -bool false
with Python, you may get the error Couldn't find an application named "Python"; defaults unchanged.
To solve this, repeat the process to get the "reopen windows?" pop-up again, but do not choose an option in the pop-up – leave it alone for now. Right-click on the Python application's icon on the dock and choose "Show in Finder". Right-click on the application icon within Finder, hold the option key, and click Copy "Python" as pathname". Paste that in as the "Application Name" for the command above and it should work.
You can disable this for a specific Xcode scheme by going to Edit Scheme, choosing the Options tab, and checking the box labeled "Launch application without state restoration."
However, this will only apply when you actually launch the application from Xcode; it won't disable the dialog when launching by double-clicking in Finder, or when launching from the terminal.
(As best I can tell, there no way for AppKit/NSApplication-based apps to do what UIKit apps can do with UIApplicationDelegate's application:shouldRestoreApplicationState: and disable persistent state entirely for the application.)

How can i add a Right Click option/options on any specific directory of window

I am creating a directory synch application in java programming application. Now i want to add share option when user right click with in a specific directory, and want to open an dynamic url on clicking that new option. Can anyone help me to find any good solution. Can anyone provide me Registry Script For this task.
An msdn resource on Extending Shortcut Menus will be good for you.
Anyway, I'd like to introduce my own "minimal" example. This opens a gnuplot's wgnuplot terminal at the right-clicked directory after choosing "Open gnuplot here" shortcut.
You can add keys into HKEY_CLASSES_ROOT\Directory\shell. I added HKEY_CLASSES_ROOT\Directory\shell\gnuplot with string (name: (Default)) Open gnuplot here, provided an icon string with the program's icon path, a LegacyEnable empty string and a command key that windows have to execute when clicking. You can reach the right clicked directory name with %V (You can find out more special variables on this Q&A thread at SU). Here's the code that creates the structure:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\gnuplot]
#="Open gnuplot here"
"Icon"="\"C:\\Windows\\icons\\wgnuplot.ico\""
"LegacyEnable"=""
[HKEY_CLASSES_ROOT\Directory\shell\gnuplot\command]
#="\"C:\\Users\\Cron\\Documents\\egyetem\\gnuplot\\bin\\pgnuplot.exe\" -e \"cd '%V'\" -persist"

How to setup MCR_CACHE_ROOT in Windows

I know this may be an easy question but How can I setup MCR_CACHE_ROOT in Windows? Can you provide me with the detailed steps. And where should I point the path to MCR_CACHE_ROOT to speed up my compiled application startup time?
For Windows 7, you set it as an environment variable as follows:
Click Start then right-click on Computer and choose Properties from the menu.
In the System window, click Advanced system settings in the left panel.
In the System properties dialog, select the Advanced tab and click the Environment variables button.
To add for all users, click New under the System variables window.
For Windows XP it's very similar and is described here.
Then you can enter MCR_CACHE_ROOT as the variable name, and the required path to variable value. Ok everything and it's done.
You can set the path wherever you like, but it's probably better to create a folder e.g. C:\MATLAB Cache and set it there.

Why can't I invoke python from the command line?

I have Python 2.6 installed on Windows Vista. If I am at C:\Python26> and I type python, Python's command-line interface starts, as desired.
I have added C:\Python26 to my PATH so that I would be able to run Python scripts from any directory, but it hasn't helped. In particular, from any other directory, the command python is not recognized.
I appreciate any guesses as to what change would get this working.
Edit: First, I have re-opened my cmd window (several times) so that is not the issue.
To clarify how I added C:\Python26 to the PATH, I clicked the following:
Computer -> System Properties -> Advanced system settings -> Environment Variables
at the point I select PATH and click Edit. I added C:\Python26 to the Variable Value field, separating this from the previous entries with a semicolon. Then I click OK a few times.
Edit #2 I've now checked my PATH by typing path at the command prompt. C:\Python26 is certainly in the path. I'll reboot anyway, and see if that helps.
This still sounds like a path issue.
If you have just added c:\Python26 to your path, then you need to open a new cmd window before those changes take effect, they won't apply to your existing cmd windows.
If you're unsure how to do this in Windows Vista, here is the instructions.
Select Settings -> Control Panel from the start menu.
Double click the 'System' icon.
Choose 'Advanced System Settings' on the left hand side.
Choose 'Environment Variables'
In the bottom list, select 'Path', and click 'Edit...'
At the end of the path string, add ;C:\Python26, leaving everything else the same, then click OK, then click OK again on the various windows still open.
Now open a new cmd window, and try the 'python' command from any directory - it should work.
This may be obvious to most people, but hopefully anyone with the same problem will find the help they need in this answer.
if you are certain that you have added the directory to the path, you may just need to open up a new command window for it to take the changes to the current path.
Double and triple check that you added the path correctly and didn't make a typo.
Restart your machine.
In the top panel where it says User Variables for YOUR NAME HERE,
select path, click the top edit button.
Append ";C:\Python26" without quotes at the end of the text in the "Variable Value" textbox.
That solved the problem for me.
Other options are to reinstall or to create a .bat file with c:\python26\python.exe and put that in your path

Resources