Live data from Hacker News

Yash: Yet Another Shell

github.com

11–20 of 54 posts

Re: Yash: Yet Another Shell

#11
post #9

I kind of wish there was a shell that had the option for histories localized to a directory. So I can go into a directory and then look at what I was doing when I was last in that directory. Some complicated compilation command line to compile and link a source file and a bunch of libraries that was run when I was last in that directory, for example. There'd still be the 'history' command for everything and then mayb…

atuin.sh

I'm an atuin user and if this feature exists, I have not seen it and would love to have it. Could you expand on how to get per-directory history as something separate from global shell history?

Re: Yash: Yet Another Shell

#12

It's quite nice. However a few basic functions are missing, like separate history for each instance.

Scenario: Something forces a reboot. I've got 4 bash shells open. I've been doing some compilation & linking of libraries with a crazy long gcc command. After I reboot, that's not in my history because only the first-opened bash shell's history seems to get saved and I've gotta recreate the commandline again. Is there any shell that would let me see all the history from all of the different shells I might have had op…

I have my zsh set up that way

# History file for zsh HISTFILE=~/.zsh_history

# How many commands to store in history HISTSIZE=10000 SAVEHIST=10000

# Share history in every terminal session

setopt SHARE_HISTORY

Re: Yash: Yet Another Shell

#13

It's quite nice. However a few basic functions are missing, like separate history for each instance.

Scenario: Something forces a reboot. I've got 4 bash shells open. I've been doing some compilation & linking of libraries with a crazy long gcc command. After I reboot, that's not in my history because only the first-opened bash shell's history seems to get saved and I've gotta recreate the commandline again. Is there any shell that would let me see all the history from all of the different shells I might have had op…

As unhelpful as the other commenter suggesting atuin was, this is actually a thing that atuin does well, if you're using a shell it supports, it commits to history immediately.

Re: Yash: Yet Another Shell

#14
post #9

Earlier quoted context omitted.

atuin.sh

I'm an atuin user and if this feature exists, I have not seen it and would love to have it. Could you expand on how to get per-directory history as something separate from global shell history?

`atuin search --cwd .`

https://docs.atuin.sh/reference/search/#examples

You could also make "directory" the default filter mode or bind it to up-arrow:

https://docs.atuin.sh/configuration/config/#filter_mode

https://docs.atuin.sh/configuration/key-binding/#custom-up-a...

Re: Yash: Yet Another Shell

#15
post #14

Earlier quoted context omitted.

I'm an atuin user and if this feature exists, I have not seen it and would love to have it. Could you expand on how to get per-directory history as something separate from global shell history?

`atuin search --cwd .` https://docs.atuin.sh/reference/search/#examples You could also make "directory" the default filter mode or bind it to up-arrow: https://docs.atuin.sh/configuration/config/#filter_mode https://docs.atuin.sh/configuration/key-binding/#custom-up-a...

Thank you! Now that I know what the feature is even called it's much easier to learn about, definitely adding this to my config file.

Re: Yash: Yet Another Shell

#16

I kind of wish there was a shell that had the option for histories localized to a directory. So I can go into a directory and then look at what I was doing when I was last in that directory. Some complicated compilation command line to compile and link a source file and a bunch of libraries that was run when I was last in that directory, for example. There'd still be the 'history' command for everything and then mayb…

You can do this with a zsh plugin: https://github.com/jimhester/per-directory-history

Re: Yash: Yet Another Shell

#17

I kind of wish there was a shell that had the option for histories localized to a directory. So I can go into a directory and then look at what I was doing when I was last in that directory. Some complicated compilation command line to compile and link a source file and a bunch of libraries that was run when I was last in that directory, for example. There'd still be the 'history' command for everything and then mayb…

Maybe you could wrangle this with direnv and changing the relevant shell history env vars.

Re: Yash: Yet Another Shell

#18
post #3

What's the tl;dr on why one would use Yash vs anything else? ReadMe doesn't really explain what's unique here.

Not sure, but it says it's the most POSIX-compliant shell. Sometimes you have a requirement for a project like "must use a POSIX-compliant shell". If all the other existing shells are only mostly POSIX-compliant, then you'd want Yash.

Re: Yash: Yet Another Shell

#19

It's quite nice. However a few basic functions are missing, like separate history for each instance.

Scenario: Something forces a reboot. I've got 4 bash shells open. I've been doing some compilation & linking of libraries with a crazy long gcc command. After I reboot, that's not in my history because only the first-opened bash shell's history seems to get saved and I've gotta recreate the commandline again. Is there any shell that would let me see all the history from all of the different shells I might have had op…

That's how bash works for me, I believe by the combination of these in my .profile:

  shopt -s histappend
  PROMPT_COMMAND="history -a"

Re: Yash: Yet Another Shell

#20

I kind of wish there was a shell that had the option for histories localized to a directory. So I can go into a directory and then look at what I was doing when I was last in that directory. Some complicated compilation command line to compile and link a source file and a bunch of libraries that was run when I was last in that directory, for example. There'd still be the 'history' command for everything and then mayb…

nushell does this by default, sort of. it will show you autocompletes that are relevant to the current directory and will fallback to history more generally.

i’m a huge nushell fan. if you can stand a non POSIX shell, it’s great for working with any kind of structured data and has a sane mostly FP scripting language

Post reply on HN