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

feature: add executed task to shell history #114

Open
a-h opened this issue Mar 6, 2024 · 2 comments
Open

feature: add executed task to shell history #114

a-h opened this issue Mar 6, 2024 · 2 comments

Comments

@a-h
Copy link
Contributor

a-h commented Mar 6, 2024

I'm enjoying using the interactive mode. One thing I've noticed, is that I'll often run xc, select docker-build and it will start.

Then I'll make some changes, and want to run it again, so I'll press the up arrow on the keyboard, or I'll use Ctrl+R to search, but docker-build is not in the history.

I think it would be a case of adding a line to either .zsh_history if the shell is zsh, or .bash_history is the shell is bash.

I can put a PR for that together if you like.

@joerdav
Copy link
Owner

joerdav commented Mar 6, 2024

I noted this as a thing that was frustrating me too, would happily take a PR!

@jdmcgrath
Copy link

jdmcgrath commented Apr 7, 2024

Hi both @joerdav @a-h.

I had a look at this, and couldn't get it to work.
I am not sure about bash, but for zsh it is perfectly possible to add to .zsh_history, though the changes to the file are not checked until after the next run of a script.
I noticed you can have a script as follows which refreshes the zsh history if in a terminal session directly:

#!/bin/zsh
fc -R

though if run through the Go Script, the effect of this is confined to the subprocess created by exec.Command, not the parent shell session.
Please see commit here for crude concept and to check out the issue I'm running into.

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

No branches or pull requests

3 participants