News for hackers. Stuff that matters.
Re:Master the command line, in one page by d4rkp4ttern on Thursday November 24, 2022 @07:42AM (#33730653)
Working at the Command Line is a superpower especially when combined with auto-suggestions from tools such as zsh + oh-my-zsh.

I would be completely lost if I didn’t have the auto suggestions as my “second brain” !

One problem though — to run a variant of an existing previous command, I find myself editing super long command lines, I.e bring up a previous command by accepting the auto-suggestion, then Ctl-b thru it and make an edit to run a new variant. This made me wonder: is there some tool that presents a TUI type of 2-dimensional interface that lets me navigate through the various options using arrow keys etc ?

Re:Master the command line, in one page by mejutoco on Thursday November 24, 2022 @08:30AM (#33731094)
I like zsh, and I want to mention the fish shell auto-completion.

I start typing anything contained in a command in history (not necessarily the beginning) and can flip through the searches with up and down arrows. It is nicely highlighted, and the default, so I do not need to spend too much time fiddling with settings.

Re:Master the command line, in one page by nequo on Thursday November 24, 2022 @07:49AM (#33730721)
Not the TUI you are asking for but TIL about Ctrl-X Ctrl-E from this link which starts up your text editor to edit the command.
Re:Master the command line, in one page by d4rkp4ttern on Thursday November 24, 2022 @08:44AM (#33731201)
Thanks for pointing this out!
Re:Master the command line, in one page by rascul on Thursday November 24, 2022 @08:03AM (#33730845)
Have you looked at hstr?

https://github.com/dvorka/hstr

Re:Master the command line, in one page by d4rkp4ttern on Thursday November 24, 2022 @08:44AM (#33731199)
Wow thanks for this suggestion. Reminds me why I love HN :)
Re:Master the command line, in one page by weeeeelp on Thursday November 24, 2022 @09:08AM (#33731401)
hey that's pretty cool! just installed and works nicely on zsh
Re:Master the command line, in one page by vaughan on Thursday November 24, 2022 @05:07PM (#33736783)
So cool!
Re:Master the command line, in one page by d4rkp4ttern on Thursday November 24, 2022 @08:46AM (#33731219)
A trick I should mention - when setting up a new machine, copy the .zsh-history file, then your brain gets ported to the new machine as well :)
Re:Master the command line, in one page by BrightOne on Thursday November 24, 2022 @10:23AM (#33732327)
https://github.com/ellie/atuin is a TUI with the added option of syncing history between shells and machines.
Re:Master the command line, in one page by d4rkp4ttern on Thursday November 24, 2022 @10:44AM (#33732604)
Looks worth checking out, thanks
Re:Master the command line, in one page by henry_viii on Thursday November 24, 2022 @01:39PM (#33734779)
Re:Master the command line, in one page by d4rkp4ttern on Thursday November 24, 2022 @04:25PM (#33736400)
Thank you. Indeed this is super nice.
Re:Master the command line, in one page by MonkeyClub on Thursday November 24, 2022 @05:52PM (#33737133)
> is there some tool that presents a TUI type of 2-dimensional interface

In an Emacs shell, that's the default behaviour - then you can edit a previous command, and by pressing Enter it gets copied to the command line and executed.

Re:Master the command line, in one page by evulhotdog on Thursday November 24, 2022 @10:59PM (#33739036)
I can’t directly answer your question, but in iTerm2, I am able to option+click to where I want to put the cursor, and it will put your cursor exactly there. This allows you to edit annoying long command with more ease and (kind of) a GUI feature in a sense.