Skip to content

Instantly share code, notes, and snippets.

@nathonius
Last active August 29, 2024 11:13
Show Gist options
  • Save nathonius/a9848df0a25706532f86dc8aaae56e4f to your computer and use it in GitHub Desktop.
Save nathonius/a9848df0a25706532f86dc8aaae56e4f to your computer and use it in GitHub Desktop.
thefuck for Cmder
@echo off
REM **************************
REM * RUN THIS FIRST *
REM * clink set history_io 1 *
REM **************************
set PYTHONIOENCODING=utf-8
set PYTHONLEGACYWINDOWSSTDIO=yes
tail -n 2 %CMDER_ROOT%\config\.history | head -n 1 > %CMDER_ROOT%\config\fucked_cmd.txt
set /p fucked_cmd=<%CMDER_ROOT%\config\fucked_cmd.txt
thefuck %fucked_cmd% > %CMDER_ROOT%\config\unfucked.cmd
call %CMDER_ROOT%\config\unfucked.cmd
@zionyx
Copy link

zionyx commented Mar 8, 2019

Attempting to enclose paths within double quotes:

@echo off
REM **************************
REM *     RUN THIS FIRST     *
REM * clink set history_io 1 *
REM **************************
set PYTHONIOENCODING=utf-8
set PYTHONLEGACYWINDOWSSTDIO=yes
tail -n 2 "%CMDER_ROOT%\config\.history" | head -n 1 > "%CMDER_ROOT%\config\fucked_cmd.txt"
set /p fucked_cmd=<"%CMDER_ROOT%\config\fucked_cmd.txt"
thefuck "%fucked_cmd%" > "%CMDER_ROOT%\config\unfucked.cmd"
call "%CMDER_ROOT%\config\unfucked.cmd"

@Heniker
Copy link

Heniker commented Jan 17, 2021

In the new versions of clink the setting is called history.shared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment