Conversation
|
See #394 |
d8a19f8 to
0ae5fb9
Compare
|
There is another design decision - Everytime I run ghostty using the wrapper, it creates an empty file in So on a second run the program logs Should I make it generate an empty config file in a store path that ghostty thinks is in the |
|
I can see that Helix does something similar by reassigning Tried doing this, it works alright but now my configs for fish, starship etc. are not picked up. If this is intended behaviour, I will clean things up and open the PR. The issue is that ghostty checks for/creates the config.ghostty BEFORE parsing the config keys passed through the CLI. |
|
Im not sure for now I will need to try it and look at the docs, I'll let you know That looks to me like it is still trying to load the regular config even with your 2 flags set? If so, that may technically be fine, unless the presence of that file causes ours not to load? But it would be nice to provide an option to choose if that happens or not? Does ours load before or after? (edit: ok, so after, so, ours would win?) Are there other files we may want to provide, or is that the only file? If its only the 1 file I would prefer to not change the whole XDG config path if we can avoid it? We will need to look into it further.
Would you mind sharing a test config I could use when I go to look at it (if one is even needed to see the behavior anyway) How are you configuring your shell? That would be what has the config for those things |
|
Using the current approach, it seems to load the config file {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
wrappers.url = "path:/path/to/flake";
};
outputs = {
nixpkgs,
wrappers,
...
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system}.default = wrappers.wrappers.ghostty.wrap [
{
inherit pkgs;
package = pkgs.ghostty;
}
{
settings = {
font-size = 26;
};
}
];
};
}This spawns a terminal in with my fish, starship etc. config loaded and the font size set to 26. The logs say So it does work as intended, however the file config.ghostty is still created in There is a test case - seeing what happens when the .config configuration file has config options set and we also pass in --config-file from the command line. However I will only be able to test that in about 15 hours |
|
I configure my shell using the NixOS fish module and starship using the starship home module. Both should generate configs in my home .config so it makes sense that ghostty can read from it. (not using wrappers, yet) |
|
yeah it should be picking up on those configs as long as it runs fish, cause starship is all done inside the shell. On first startup, without the file existing on subsequent startups ^ So, yes, it makes the config, and then proceeds not to use it at all because you have --config-default-files=false set That is somewhat odd behavior, but I don't see the harm in it generating the file if it is not already present, as long as it is not using it, or using it in addition I would assume it is just saying "read" when it means "check if its there so we can make the template config or not and possibly check that they are valid settings" The template config it generates is |
|
I am also not getting that error you mentioned either the first time or subsequent times logs from first time logs from second time Edit: The error only happens if the config there is LITERALLY empty. If it is missing, they create it, we don't need to. The error also doesn't stop it from loading or anything, and it still is just going to ignore it anyway. Its fine how you have it I think. |
|
It also appears to pick up on my starship and zsh configs, which I am using wrappers for. But that is expected, its just running the zsh from my main system environment, which is that one. I am running it with an empty config. I will try with a setting or 2. Edit: still seems to work. font size 26 is absolutely gigantic I built it in the repl |
|
They have some kind of service thing? Lets patch it with the path to the final wrapper instead of the base ghostty program. config.filesToPatch = [
"share/applications/*.desktop"
"share/dbus-1/services/com.mitchellh.ghostty.service"
"share/systemd/user/app-com.mitchellh.ghostty.service"
];Otherwise, yeah this looks good to me. It only gives the warning when the file is both present and literally empty. And it doesn't use anything from it anyway. |
|
Oh, also, the tests are just failing because you have not ran Im not always super happy with its formatting, but having a standard one is good, at least they are all equally as unreadable at first until you get used to it and then its easier to read code from random people who might format differently. |
That is interesting, on my system it seems to generate an empty file at the path mentioned rather than filling it with the lines that have comments. I will add the Thank you for doing the legwork, my future PRs will be smoother! 😅 |
b2b1dc6 to
cdb0875
Compare
|
Alright, CI passes and the module builds. There may be a few more things to sort out before this is ready to merge. First, the maintainers documentation asks me to set the file name to And second, I wanted to add a |
Lmao so it does. This is incorrect. module.nix is correct.
??????? That also appears to be the case. Quite mysterious. |
|
@BirdeeHub It seems that this is an issue with ghostty itself (running |
|
You would pass this in the tests Does it work if you do Edit: no This is definitely a bug on their end. We should open an issue on their repo about this, that you cannot set |
|
What we should do is file an issue on the ghostty repo telling them their terminal emulator doesnt allow you to do --help if you have provided other arguments. Is there anything else wrapping it prevents? or is it JUST Edit: it seems to be more than just Edit 2: actually, it seems to be able to set settings, just not --help, and settings provided by the config file win over those provided from the command line |
I was just testing this and that seems to be the case. One would expect the command line to win, but it does not. I'll ask if this behaviour can be changed in the discord. |
|
Honestly, I would rather not override it still I would rather they fixed their bug. That is definitely a bug on their end. Would you mind filing an issue there, and linking here with it so that they can see the context and we can go here to see updates about it? If you set any settings like |
|
Before filing an issue, we should make sure they haven't already fixed this and nixpkgs is just behind |
I will need to get vouched first, but yeah this seems like a bug on their end. I'll see if this is being worked on and file an issue if not. |
|
Also, I should add, the reason I don't want to set XDG is because unless your shell config changed it, that would set XDG for your whole terminal. So I would really rather not if we can help it for terminals, because when running stuff with the shell it could have an unintended effect Do they have a variable we can set instead of --config-file? I suppose we would still need the other flag regardless, which would still trigger the issue... |
|
Apparently he uses discussions as issues? Edit: Oh, I missed yours ghostty-org/ghostty#11987 Closed mine as duplicate and dropped a link to it in yours |
|
All good. I think you should reopen your discussion as mine is a vouch request which would (hopefully) allow me to contribute. Yours has more details anyway. I also tried texting in the dev channel on discord but it didn't gain any responses there. This merge would be pretty sick though, I've been meaning to switch from wezterm for a while now |
|
Im thinking it might just be OK for now, because this is almost certainly a bug they will fix? But also, I am thinking that there is not necessarily reason to rush to get it into the repo before they do. And, sure I will reopen it. I wasn't sure about the rules, and it seemed like maybe it was a duplicate. |
|
Yeah, I agree. Better to merge this only when the program is 100% usable. |
|
I mean... IMO it won't be 100% usable until we can specify the path to a font via an actual path and not just a name (like we can in wezterm, which is really nice for wrapping, although, to be fair, wezterm is the only one I know of which allows this) So, 100% usable isn't necessary, but it would be nice if that particular bug were fixed first 🤣 But yeah if they fixed this bug and added that feature, I would switch to ghostty personally, just because I don't need 90% of terminal features anyway due to being a tmux user and it likely has better kitty graphics support. (I found out zellij has wasm plugins recently, and am interested... but tmux solves all my problems as-is, so, maybe someday I will check it out but not soon. We do have a wlib.toKdl now though.... which would be useful for zellij) |
Add wrapperModule: ghostty
https://ghostty.org/