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

is unix history command available? #172

Closed
ghost opened this issue Feb 16, 2014 · 16 comments
Closed

is unix history command available? #172

ghost opened this issue Feb 16, 2014 · 16 comments

Comments

@ghost
Copy link

ghost commented Feb 16, 2014

From edsanj...@gmail.com on December 20, 2013 21:20:01

Hi all,

is it possible to have the list of the past command typed, same as unix history command.

If not, can be implemented as custom lua script?

Thanks
Ed

Original issue: http://code.google.com/p/clink/issues/detail?id=173

@ghost
Copy link
Author

ghost commented Feb 16, 2014

From edsanj...@gmail.com on December 20, 2013 13:05:01

just read https://code.google.com/p/clink/issues/detail?id=119&can=1&q=history and unfortunately isnt possible :-(

@ghost
Copy link
Author

ghost commented Feb 16, 2014

From martin.r...@gmail.com on December 22, 2013 03:39:47

This request has come up quite a few times now so I do plan on implementing Bash's "history" command, probably fairly soon.

@ghost
Copy link
Author

ghost commented Feb 16, 2014

From edsanj...@gmail.com on January 07, 2014 07:42:31

Looking forward to it!
Thanks

@ghost
Copy link
Author

ghost commented Feb 16, 2014

From martin.r...@gmail.com on January 21, 2014 12:19:24

Status: Accepted
Owner: martin.r...@gmail.com

@ghost
Copy link
Author

ghost commented Feb 16, 2014

From martin.r...@gmail.com on February 04, 2014 16:45:11

Issue 182 has been merged into this issue.

@refack
Copy link

refack commented Sep 25, 2014

👍

refack pushed a commit to node4good/clink that referenced this issue Oct 3, 2014
@albfan
Copy link

albfan commented Jan 13, 2015

You will not have actual session avaliable until you exit, but here is my to cents:

doskey history=cat C:\Users\X53526FA\AppData\Local/clink/.history $*
doskey lhg=cat C:\Users\X53526FA\AppData\Local/clink/.history $B grep $*

lhg stands for ls history grep, and it's a handy alias

@mridgers
Copy link
Owner

If you enable the history_io setting (available from v0.4.3) then the .history file will be written to every line entered. Native support for the history command is under way, albeit slowly.

@albfan
Copy link

albfan commented Jan 19, 2015

That's a long time wanted feature. It's my default config on *nix systems.

Can you share some clues about your plans? Over all I miss !!$ and !!:x. I use it all the time with

> mkdir blablabla
> cd !!$

or

> super-complex-command
> echo !!:x > %userprofile%/bin/handy-script.cmd

@mridgers
Copy link
Owner

Readline's history expansion works fine in Clink as per the manual at least.

As for plans, I'm working on detailed parsing of the entered line so Clink can condition it, expose it to Lua before it's returned to cmd.exe, etc. Part of that will be support for "history", and perhaps Bash-style backtick expansion.

@joce
Copy link

joce commented Dec 29, 2015

Hello Martin. Last comment on this issue is almost a year old. Do you have an ETA for the implementation of the bash-like history command? Is it still on your radar?

@mridgers
Copy link
Owner

I've given it some though, but not a lot to be honest. Clink's not got many new features simply because most of my time gets spent addressing issues. I do have a working parser for entered lines but haven't been able to get it to the point where it can be used to offer solid post-processing of a line before it's handed back to cmd.exe.

Bash's built-in 'history' command does quite a lot. Is there a common use-case that's particulary important? I wonder if this is it;

C:\>history | grep dir
  5  dir c:\foobar
 21  dir c:\windows
C:\>!21

@bostone
Copy link

bostone commented Jul 15, 2016

Personally I think this is huge oversight. I just installed Clink with sole purpose to have a history and turns out I can't have it? Real disappointment for me

@regisbsb
Copy link

Create a bat file called history in windows folder.
Put the command in this answer:
https://superuser.com/questions/1019441/getting-the-list-of-command-history-using-clink

type "%LOCALAPPDATA%\clink\.history"

But by default clink writes history only on exit, to change it: clink set history_io 1 or modify history_io value in %LOCALAPPDATA%\clink\settings
Done.

@albfan
Copy link

albfan commented Dec 21, 2017

@mridgers So you finally made it. Awesome

@aleksander351
Copy link

aleksander351 commented Jun 4, 2018

You can put the .bat file into the C:\Users\<USER> folder.

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

No branches or pull requests

7 participants
-