When spawned with a directory, interpret it as the starting cwd
When Contour is started from a desktop integration (e.g. right click -> open with -> contour), unfortunately the integration only fires contour [... directory path ...]. This causes contour to crash because a directory cannot be started as a program image.
The solution would either be:
- Implement desktop integrations that work with the right-click menu. This might be problematic due to the absolute plethora of desktop environments to support.
- "Hotwire" Contour so if it is spawned with only a directory as the first argument, interpret it as "start with the default profile but spawn the configured shell in that directory".
For example, Konsole does not crash (at least...), but is also rather buggy: when opening, from Dolphin, Konsole in ~/foo/bar as the "Open with..." action, it spawns the default shell in ~/foo.
Oh this is interesting, I can look into this one later, the whole topic of .desktop files is convoluted
This could be fixed by being a little bit more smart and check the file modes to decide if it is supposed to be the CWD or shell.
@uspasojevic96 Mind, I broke the master branch (RGB colors) last night, I will fix that tonight. Sorry.