Skip to content
New issue

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

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

Already on GitHub? # to your account

[Solved myself] .bash_history and winscp.rnd are not in Cmder's directories #1050

Closed
ghost opened this issue Jul 22, 2016 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Jul 22, 2016

The following two files are created "out-of-place" (meaning: outside the "cmder" working environment):

.bash_history gets created in %USERPROFILE% (i.e. C:\Users\username).
winscp.rnd is created in %APPDATA% (i.e. C:\Users\username\AppData\Roaming)**

**Note: I do NOT have WinSCP installed. Deleting the file and starting Cmder creates it anew, so it clearly originates from there.

I think especially .bash_history should be stored %CMDER_ROOT%\config.bash_history ... as .history (for cmd.exe) is already stored there (apart from it being insanely handy to have your commandline history at hand when Cmder is being run off a USB thumb-drive).

@ghost
Copy link
Author

ghost commented Jul 25, 2016

Okay, I solved the problem with .bash_history ....

Edit %CMDER_ROOT%\vendor\git-for-windows\etc\bash.bashrc

Find the line reading "# Fixup git-bash in non login env "

ABOVE that line, add ...

CORRECTLY set bash history location to be within CMDER's directory structure

HISTFILE=$CMDER_ROOT/config/.bash_history

And while you are at it, you may also want to get rid of "clink.log" created in %LOCALAPPDATA%\clink\clink.log ....

Edit %CMDER_ROOT%\vendor\init.bat

Find the line ":: Run clink"
Modify the line BELOW from...

"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"

... to ...

"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --nolog --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"

Hint: You're adding "--nolog" in between "--quiet" and "--profile" to disable that log-file (totally needless).

Note: You may have to redo the edits in case a future CMDER update overwrites the files without these changes being incorporated.

Oh, and since I removed "PuTTY" from my path "winscp.rnd" also disappeared (deleted and didn't come back). No idea why it happened, couldn't find a reason after auditing all the scripts to do the changes I documented above.

@ghost ghost changed the title .bash_history and winscp.rnd are not in Cmder's directories [Solved myself] .bash_history and winscp.rnd are not in Cmder's directories Jul 25, 2016
@ghost ghost closed this as completed Jul 25, 2016
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants