cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.75k stars 176 forks source link

Add mode for chaining multiple commands #327

Open YuviTz1 opened 1 year ago

YuviTz1 commented 1 year ago

Added a new mode ChainCommands which can be selected using Shift + Tab.
Further pressing Shift + Tab will chain commands. Pressing Tab will shift to edit mode and enter key can be used to execute the formed chain. Possible implementation for #294. Do tell me if something needs to be changed :)

cantino commented 1 year ago

Cool idea @YuviTz1! It seems to work for me.

I think when you first hit shift + tab, whatever command you're on should be added to the chain right away. Seems like you have to hit it twice right now.

Also, how do you remove something from the chain?

The highlight color is very hard to read though:

image
YuviTz1 commented 1 year ago

Update:

Going into chain mode adds selected command to the chain.

Press F3 to remove commands from the chain. However do note that previously executed chains will be treated as a single command in the new chain when removing. Example: image

Any suggestions for Highlight color?

cantino commented 1 year ago

Needs to be rebased.

YuviTz1 commented 1 year ago

I have rebased the changes but now if the command chain takes up more than one line in the menubar, Only the first line updates successfully when removing commands from the chain for example- image Here, after removing the last command from the chain, 2nd line of menubar is not refreshed. This behaviour was not present before rebasing.

cantino commented 1 year ago

I think the way that we cleared lines got changed with @jtschuster's upgrade. Do you want to either truncate at the screen width or make this show up on its own line below the header?