devbox icon indicating copy to clipboard operation
devbox copied to clipboard

feature request: devbox shell history should use or append to existing shell history

Open savil opened this issue 2 years ago • 6 comments

Filing this on behalf of @mjgallag who writes:

I found this convo while considering logging a feature request to use (and append to) existing shell history. Before devbox I made a decision to go with asdf over dev containers or nix at my company for the primary reason that us devs are persnickety about our shells. I'd like devbox to fade into the background as much as possible and this feels like a rough edge to me.

Previously, we'd implemented a strict separation of devbox shell history and outside shell history in #204. The motivation was that it'll be easier for folks to maintain context for their work within a project by having this separation. That said, as can be seen from the comments in that PR, we had low confidence in whether this was the right choice and wanted to revisit after using it a while. So, thank you @mjgallag for raising the question.

savil avatar Apr 21 '23 18:04 savil

I'll poke some others to chime in.

@mjgallag in the meantime, one alternative workflow I'll suggest is using direnv. See our docs on enabling it: https://www.jetpack.io/devbox/docs/ide_configuration/direnv/.

The idea behind direnv is that the "devbox environment" gets set up as you cd into the directory. And it'll naturally continue appending to your regular shell history.

Personally, I've come to use this as my default workflow, over remembering to type devbox shell. I'm curious to hear any feedback you may have on this approach. I totally get you on "us devs are persnickety about our shells" :)

savil avatar Apr 21 '23 19:04 savil

@savil ah, I didn't realize that direnv would have that effect on shell history, will check it out!

Our current solution (that predates devbox) actually includes direnv (along with asdf). I spent quite some time ensuring I had as little effect as possible on dev's systems outside of our project's dir and getting asdf/direnv to plumb correctly into docker images and github actions so devbox is certainly looking promising.

mjgallag avatar Apr 21 '23 19:04 mjgallag

@savil Can we have an additional option for devbox shell command to decide whether devbox should append to existing shell history? Like --append-shell-history?

athrunsun avatar Nov 23 '24 07:11 athrunsun

How is this going guys?

meichengg avatar May 14 '25 04:05 meichengg

@meichengg As a band-aid, you could probably jury-rig up something with "$(devbox shell --print-env)", which allows you to skip the overriding of the history file (but also skips all of the other setup that devbox performs).

DUOLabs333 avatar Jul 14 '25 23:07 DUOLabs333

Would really love this!

tpendragon avatar Nov 07 '25 21:11 tpendragon