Skip to content

Conversation

NotTheDr01ds
Copy link
Contributor

Implemented suggestion in #1072:

  • Added !!, !$, !<n>, and !<-n> history substitutions
  • Also added a few Bashism keybindings and pointed to the Reedline chapter for the rest.

@fdncred
Copy link
Contributor

fdncred commented Aug 8, 2024

You can reference this link https://www.nushell.sh/blog/2024-05-15-bashisms.html and I think there may be one missing.

@NotTheDr01ds
Copy link
Contributor Author

Thanks - Definitely missed one. I forgot about the blog post and was just going from what I could grok from the source ;-)

Are you saying that I should put a link near the table in the Book to the Blog post? Or just that I could use it for my own reference?

@fdncred
Copy link
Contributor

fdncred commented Aug 8, 2024

I'm fine with putting the blog information in the docs, no need to link to it.

@NotTheDr01ds
Copy link
Contributor Author

Sounds good - Should be ready to merge if the update for !<string> looks good.

@NotTheDr01ds
Copy link
Contributor Author

NotTheDr01ds commented Aug 9, 2024

Thanks - Copy/paste error. Fixed.

@fdncred
Copy link
Contributor

fdncred commented Aug 9, 2024

Now that I look at these again, they don't repeat anything. They just get the info and put it on the command line. Bash repeats. Nushell just gets but doesn't execute.

@NotTheDr01ds
Copy link
Contributor Author

NotTheDr01ds commented Aug 9, 2024

I think "repeat" works since it repeats the entering of the text on the command line, but what about "substitute" in place of "repeat"?

I can also add a brief explanation of the difference in behavior.

@fdncred
Copy link
Contributor

fdncred commented Aug 9, 2024

I think the key point that we need to make is that it does not work the same as bash. In bash you type !! and it runs the last command. I nushell you do !! and it puts the last command on the commandline but does not execute it. I'm not sure substitute or repeat convey what it does. Get is closer but it's not quite that either. Just pick one and put some blurb that describes the functionality, and I'll land it. Thanks for helping!

@NotTheDr01ds
Copy link
Contributor Author

"Insert" - I think that's the word we're looking for. Updated.

@fdncred fdncred merged commit 44889b4 into nushell:main Aug 9, 2024
2 checks passed
@NotTheDr01ds NotTheDr01ds deleted the bash-history branch August 17, 2024 15:08
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

Successfully merging this pull request may close these issues.

2 participants