Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save options (0.7.7.1) #45

Closed
JDQuackers opened this issue May 24, 2017 · 13 comments
Closed

Can't save options (0.7.7.1) #45

JDQuackers opened this issue May 24, 2017 · 13 comments

Comments

@JDQuackers
Copy link

JDQuackers commented May 24, 2017

This is almost identical to issue #42, but on the latest version 0.7.7.1 with slightly different error:

screenshot 2017-05-24 14 39 44

I've never installed wsltty before, so I just did a fresh install. I then:

  • Open a terminal via the auto-created desktop shortcut "WSL Bash ~ in Mintty"
  • Click the icon -> Options...
  • Modify window size
  • Click "Save"

An error window pops up saying "could not save options to.." (see attached). The path it is using is %LOCALAPPDATA%\wsltty\home$user.minttyrc

Looking in this directory in Windows there are only two dirs, bin and usr:
screenshot 2017-05-24 14 51 16

... is there some step I missed needing to invoke/setup a user in cygwin so that this home dir is created?

@mintty
Copy link
Owner

mintty commented May 24, 2017

The configuration location from your error message is not the intended one.
I have the suspicion that the creation of the dedicated shortcuts may have failed during installation, so that the package-supplied default shortcuts were installed instead.
Can you please check that: On the desktop shortcut, right-click and open "Properties", copy the contents of the "Target:" field and report it here.
As a workaround, I can adapt the default shortcuts to point to the new default location already.

@JDQuackers
Copy link
Author

Sure:

%LOCALAPPDATA%\wsltty\bin\mintty.exe --wsl --configdir="%APPDATA%\wsltty" -o Locale=C -o Charset=UTF-8 /bin/wslbridge -C~ -t /bin/bash

@mintty
Copy link
Owner

mintty commented May 24, 2017

This does not confirm my suspicion.
Please check your %APPDATA% folder. Was the wsltty subfolder created? Is it writable?

@JDQuackers
Copy link
Author

JDQuackers commented May 24, 2017

Well, %APPDATA%\wsltty was created and contains lang, sounds and themes, which are all empty. No config folder. I assume if it exists, then it's writable... but writable by whom? My windows user can create/edit a text file within that folder (same user that ran the wsltty installer)

@mintty
Copy link
Owner

mintty commented May 24, 2017

So that's fine. There is no additional config folder. The config file would be %APPDATA%\wsltty\config -
What happens if you add such a file, and place a setting in it, e.g.
Font=Comic Sans MS
?

@JDQuackers
Copy link
Author

JDQuackers commented May 24, 2017

Hmm... well. I did that and it still provides the same behavior:
screenshot 2017-05-24 15 57 05

So now I'm seeing Issue #43 ... I tried to run the shortcut once as admin "Run as administrator...", and now if I do not select that every time, it hangs. If I run as admin, then it opens normally. In this mode, the font is still default (not Comic Sans) and the "Save" button still prompts with the exact same error as this most recent screenshot. Note: the first time I ran the shortcut as admin was after the initial discovery of the Save settings error. I wondered if running as admin would fix it, but it did not, and seems to have broken something else.

I can do a full uninstall/reinstall next, or leave it like this if you'd prefer to continue to debug either issue?

(Edited for clarity)

@mintty
Copy link
Owner

mintty commented May 24, 2017

Puzzled. I'll have to try myself later...

@aguacatedan
Copy link

I'm having the exact same issue. I just installed wsltty today.

Here's what I've been trying:

  1. Open Cmder
  2. Create task: %LOCALAPPDATA%\wsltty\bin\mintty.exe --wsl --configdir=%USERPROFILE%\AppData\Roaming\wsltty -o Locale=C -o Charset=UTF-8 /bin/wslbridge -C~ -t /bin/bash
  3. Run new console window with newly created task.
  4. Try to save options.
    A dialog window pops up indicating same issue as OP.

It's also worth noting that this happens even if I run it from Desktop shortcuts or from the wsl*.bat files. Seems to me that it's not taking the --configdir option and going always with the default path /AppData/Local/wsl/home/<user>/.mintty.rc

image

@JDQuackers
Copy link
Author

Hey, I was able to correct this behavior by changing the shortcut to:
%LOCALAPPDATA%\wsltty\bin\mintty.exe --wsl --config="%APPDATA%\wsltty\.minttyrc" -o Locale=C -o Charset=UTF-8 /bin/wslbridge -C~ -t /bin/bash

I looked at the mintty docs and noticed there was no configdir option, only config, which should point to a filename...

Now, after making this change, saving options works correctly; however the Administator issue still stands. I've ticked the "Run as Administator" option in my shortcut as a workaround for now

@mintty
Copy link
Owner

mintty commented May 25, 2017

The option --configdir exists and is described in the manual.
The problem is that it does not enforce the config file in that directory if it does not exist already.
If you create an (empty) file %APPDATA%\wsltty\config before starting the terminal, it should work.

I had initially designed --configdir to cause saving always to go there but later revised that to allow the option to use common configuration with other mintty installations, using the %APPDATA%\mintty directory, so not to override the config file in there with the new one (in %APPDATA%\wsltty) if it does not exist. Apparently there is a dependency loop in the functional design here that needs to be resolved.

@JDQuackers
Copy link
Author

@mintty wow, I can't believe I missed that. I was looking at an old StackExchange thread when I first noticed --configdir missing from the --help output and then didn't scrutinize the actual manual well enough. Sorry about that

@mintty
Copy link
Owner

mintty commented May 25, 2017

Released 0.7.7.2 with workaround. Please recheck.

@JDQuackers
Copy link
Author

Works great, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants