Closed edmcman closed 5 months ago
For vscode:
https://github.com/bevry/dorothy/blob/master/docs/dorothy/dorothy-not-loading.md#visual-studio-code
for why login shells, in the same document:
If Dorothy were to load itself on non-login shells then every shell command would also have to load Dorothy which would be be an unnecessary slow down to every shell command! By having Dorothy only load inside login shells, we allow everything to work perfectly.
this is because even command executions (depending on platform, shell, etc) can also load the rc/profile config files, in which case as Dorothy uses commands instead of functions, this would cause noticeable slow downs for each command invocation.
To support raspberry pi os default terminal not allowing login shells, I do have an explicit exemption for that: https://github.com/bevry/dorothy/blob/6ab04b20db7d4ddee6c7d261a42bbfd2d79a1f0a/init.sh#L72
If necessary for notion, the same could be done. However if Notion does support login shell configuration, that should be done. Or perhaps I can check for an env var like DOROTHY_LOAD_ON_NONLOGIN=yes. Perhaps @molleweide knows a trick for this, as I believe he ran into such for something before.
One option I've been considering is even in non-login shells still exposing the dorothy
command, so you can still do dorothy run ....
or perhaps even a new dorothy load
In notion, what happens in the bin/sh instance if you then run bash -l or fish -l or whatever?
Sorry for not RTFM :-( I obviously stopped after finding the solution for gnome-terminal, and then forgot there was more!
So, in notion, if I run bash -l -c 'google-chrome-personal blah.com'
it works! google-chrome-personal
is a dorothy
custom command.
I don't think notion supports login shells, but let me take a quick look at the source code to find where the call happens.
This is what gets called...
So I could modify that a bit to always add a bash -l -c
wrapper and I think it would work. Though auto-completion wouldn't work, which is a bit disappointing.
Let me see if I can just add a bash -l -c
in my X session setup, and if everything will basically just propagate downstream.
Cool, that worked! I have auto-completion and everything :-)
I do think it might be easier for new users to have an env. variable instead of spawning a login shell. Or maybe it's just me but it still feels weird.
Anyway, thanks for the help! Time to write some more commands.
For posterity's sake, here's what I did:
https://github.com/edmcman/ansible-notion/commit/6b56482e90838d8f23b01ecf67e0b714521f9824
I'm running into a few issues with having dorothy only apply to login shells. It's easy enough to modify gnome-terminal to use a login shell, as suggested in the README.md. But I've run into two scenarios that aren't as easily handled:
What is the rationale for only applying dorothy on login shells? Do you have any suggestions for how to work around this? (I'm wondering if I can sneakily add in a
bash -l
somewhere during window manager initialization or something like that...)