How can I make a Konsole profile that uses DistroBox remember the current directory when I open a new tab?

I have a Konsole profile setup like this, to open my DistroBox profile by default:

Unfortunately, it doesn’t remember the current directory I’m in when I open a new tab, even though I have “Start in same directory as current session.”

2 Likes

There is a DBX_SKIP_WORKDIR in the distrobox documentation but what it does for distrobox enter doesn’t appear to be documented :thinking: .

Looking at Command : Is toolbox the name of your container? or is this you calling toolbox from a distrobox command?

This took me a bit to grok as well. Toolbox is the name of the konsole profile, but OP is using Distrobox instead of toolbox. Distrobox is a very similar tool to toolbox that is also popular among non-Red Hat distros.

Yeah, but it threw me off that the OP would call toolbox from a distrobox command, but the Konsole is called Toolbox and the container is named toolbox . . .

Either way, I don’t have distrobox, so not sure . . .

Sorry for the confusion haha. It’s just my “toolbox” container, so I called it that. It can be used with toolbx or DistroBox though.

1 Like

Well, I set that to 1, but it didn’t seem to do much.

Yeah - I don’t see a way to pass the entry path with the distrobox enter command or else you might be able to pass an arg there. Might be a good question to ask the Distrobox folks.

I’ve done systemd/cron integrations with toolbox before, but not Distrobox. I do also use Distrobox, but just not for what you’re trying to do here.

Good idea. I’ll ask them

I’ve done systemd/cron integrations with toolbox before, but not Distrobox. I do also use Distrobox, but just not for what you’re trying to do here.

How did you set toolbox up with systemd/cron?

Does this work if you use toolbox instead?

Also, is there any difference if you distrobox enter vs opening a new tab?

I ask because this all works as expected with Prompt + toolbox.

I switched out distrobox with toolbox, and it still doesn’t work. This is my Konsole profile, for reference:

[Appearance]
ColorScheme=Gruvbox
Font=JetBrainsMonoNL Nerd Font,11,-1,5,50,0,0,0,0,0

[General]
Command=/usr/bin/toolbox enter toolbox
Environment=TERM=xterm-256color,COLORTERM=truecolor
Name=Toolbox
Parent=FALLBACK/
StartInCurrentSessionDir=true

[Scrolling]
HighlightScrolledLines=false
HistorySize=10000

[Terminal Features]
BlinkingCursorEnabled=true

Cant you use multiple commands after another? Or just do something like echo "cd $PWD" | distrobox-enter toolbox ?

I tried both echo "cd $PWD" | distrobox-enter toolbox and echo "cd $PWD" | distrobox-enter toolbox -- -, but those don’t work. Konsole being the default for Plasma, it seems odd I can’t find anything about this issue online.

I installed konsole and distrobox in a Workstation 39 VM, and it works. Here’s the profile I created:

$ cat ~/.local/share/konsole/Distrobox.profile 
[General]
Command=distrobox enter fedora-39
Name=Distrobox
Parent=FALLBACK/

I’m just doing cd Downloads and then opening a new tab using that profile.

I feel like I’m losing my mind here. I just did the same thing and it didn’t work. I also tried switching from fish to bash but that didn’t work. Could it be an issue with Kinoite? Can I see your ~/.config/konsolerc?

$ cat ~/.config/konsolerc 
[Desktop Entry]
DefaultProfile=

[General]
ConfigVersion=1

[MainWindow]
3840x2002 screen: Height=679
3840x2002 screen: Width=1015
State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAiAFEAdQBpAGMAawBDAG8AbQBtAGEAbgBkAHMARABvAGMAawAAAAAA/////wAAAT8A////+wAAABwAUwBTAEgATQBhAG4AYQBnAGUAcgBEAG8AYwBrAAAAAAD/////AAAA7wD///8AAAP3AAACagAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAQAAANb/////AAAAAAAAAAA=
ToolBarsMovable=Disabled

[UiSettings]
ColorScheme=

It works if I start outside of my container, change directories, and then open a new tab in my container, but not if I start inside my container. Can you try the latter, please?

Do you mean having the Distrobox profile as default? I can’t find any combination of steps where it fails.

I’ve tried opening a Konsole window where it launches distrobox by default, changing to ~/Downloads, and then opening another distrobox tab and a host tab.

Really? That’s so weird. I would think it was container, but it still didn’t work with the Fedora 38 one. This is either a Kinoite, DistroBox, or Konsole issue, but I’m not sure which.

Do you think you could give me more information about your setup?