Giter Site home page Giter Site logo

Comments (3)

hgkamath avatar hgkamath commented on August 27, 2024

workaround:
point .config/wezterm to the persists\wezterm folder, seems kludgy

PS C:\Users\gana\.config> cmd /c "mklink /J wezterm C:\vol\scoop_01\scoopg\persist\wezterm" 

junctioning the wezterm config directory achieves the same effect as WEZTERM_CONFIG_FILE environment variable.
The more I think about it, I wonder why, I had originally set up to use the WEZTERM_CONFIG_FILE way of loading the wezterm lua in the first place.
The most plausible reason is that I have a dual boot machine windows linux, with admin and unprivileged user that is accounts, I think I was trying to avoid having to make and manage 4 configurations in 4 places, and sometimes I swap entire OS partitions placed in VHDX files. So I put the wezterm.lua in an accessible place outside of the private user folder and also outside the C:\ file system. C:\vol\scoop_01 is a mount point of a VHDX, the VHDX itself residing on a different partition

The config file can also be provided by the command line --config-file argument. The docs say the command line take precedence over the environment variable. Maybe even for this case the config directory should be set similarly ?

Q) When would one prefer to use the environment variable method over a filesystem junction method?
A) maybe when (a) filesystem does not have junctions, (b) unprivileged user by OS group policy not allowed to create junctions.

from wezterm.

wez avatar wez commented on August 27, 2024

I'm not really clear on what you're doing, but I do want to note that you can put something like this at the top of your main wezterm.lua file (the one that WEZTERM_CONFIG_FILE points to):

local wezterm = require 'wezterm'
package.path = package.path .. ";" .. wezterm.config_dir .. "/?.lua"

You can arbitrarily change package.path to match your environment.

from wezterm.

hgkamath avatar hgkamath commented on August 27, 2024

Thanks for your reply and for wezterm

  • I'm not really clear on what you're doing

    • Motivation for setting things up the way I did.
      • My machine is setup to do dualboot, multiboot. There was a time when I was reinstalling/trying-out various WinOS and Linux Distributions on my laptop. Presently, I now have about 3 commonly used multi-boots: Win10, Win11, Linux. There are virtual machines also., and I can boot into liveiso-s using ventoy.
      • At one time I wanted a zero-configuration way to use wezterm, so that I don't have to copy or setup up the config directory of various ephemeral newly setup operating systems. Doing otherwise is tedious.
      • Copying the configuration to multiple places requires having a method to keep track of changes. You could say why not use a vcs like git, I hadn't thought of that, and still haven't got around to taking the initiative to do that.
      • Setting a Environmental variable is easy, and can even be done by a ansible script.
      • Saving things outside of the OS partition means not having to worry about backing things up when removing a OS, or setting things up after installing.
      • The WEZTERM_CONFIG_FILE lends itself as a easy way to do the above.
      • The reason I hadn't run into this earlier is because so far my wezterm config was self contained and had not modularized it to rely on files sourced from outside the main config file, as was recommended by reddit link I had included
  • package.path

    • Okay, I hadn't thought aboutpackage.path
    • I am not proficient in a lua and it hadn't occurred to me that it was in-user-script modifiable.
    • The 2 docs below use the phrase "The Lua package.path is configured with the following paths" , so that made me think it was a preset.
    • This could be a sufficiently usable workaround.
    • If this is the recommended way to do set the module search path, then one may close this bug.

Ref :

from wezterm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.