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
How to detect if the shell is interactive and login? #1726
Comments
I'm guessing that it doesn't exist yet, and when it does exit it would be at |
The Fish shell needs those tests because its config.fish script is loaded by every Fish shell; regardless of whether it is interactive or not. Elvish does not need the equivalent because its rc.elv script is only loaded if the shell is interactive. It is also unlikely that Elvish will ever distinguish between login and non-login interactive shells. So it is sufficient to simply add, without any conditional code, your initialization statements to rc.elv. Although, I personally prefer that utilities like Dorothy simply tell me what to add rather than munging my startup script. If you do decide to automatically see https://elv.sh/ref/runtime.html#$runtime:effective-rc-path and https://elv.sh/ref/runtime.html#$runtime:rc-path. |
Okie, so getting the following:
edit: nevermind, didn't realise I needed |
That's the plan. |
That is a very common mistake. So common that it might be worthwhile to modify the error message to suggest to the user that they should |
FWIW, I am a grey beard. I started programming in the 1970's and got acquainted with UNIX in the mid 1980's. Which means I was familiar with the concept of a "login" shell as a shell spawned by the |
This seems the final head scratcher for me:
Is outputting:
Which is baffling me as to why an empty or non-defined DOROTHY_THEME_OVERRIDE is causing DOROTHY_THEME to be set to it, and then why my sanity checks of
I'm guessing this, and the
I tried to search for resources, but this was the only result: https://github.com/search?q=%22if+body+must+be+lambda%22&type=issues |
Figured it out, needed
|
I am going to assume that is a typo. :-)
You have misunderstood the purpose of the |
Thank you. I also found https://elv.sh/learn/unique-semantics.html very useful. One final thing, related to CI. I'm now trying to test the Dorothy integration with Elvish on CI, and getting:
https://github.com/bevry/dorothy/actions/runs/6439819213/job/17487942227#step:9:1 Prior to that, I had tried this with the same error:
https://github.com/bevry/dorothy/actions/runs/6439804989/job/17487912535#step:9:2 It's installing elvish 0.17.0-1
|
Will try using the prebuilt binaries instead. |
Same situation was 0.19.2 prebuilt binary:
https://github.com/bevry/dorothy/actions/runs/6440000404/job/17488345034#step:9:1 |
The
There is no need for
Is It is unclear why you are loading rc.elv. That file would typically contain statements that don't make sense, and won't even work, in a non-interactive shell. For example, key bindings, command abbreviations, and REPL variable definitions. Here are just a couple of examples from my rc.elv:
It would be simpler to put whatever you're inserting into rc.elv into a different file that also includes your unit tests then simply execute that test script; e.g., |
I couldn't get relative imports working properly:
Using a absolute path also did not work:
👍
Yes, providing the Dorothy configuration is loaded (which modifies the PATH).
Understood, will import Dorothy's configuration directly. |
For good or bad absolute import paths are not supported at this time. Your most recent change to your project is still using
That won't work without jumping through more hoops. In particular see the discussion about using the |
@balupton Were you able to get your Elvish integration to work (in which case this should be closed) or do you need more assistance? |
The integration worked well enough. I'm leaving anything else up to any potential future dorothy and elvish user. Happy to close, thanks for all your assistance |
I wish this was documented in "Unique Semantics" or something. Had to dig my way here to figure this out. That said, how does elvish handle user-applied paths? Say I have a cross-compile SDK in |
It's documented here.
It's not clear what you mean by "user-applied paths" or "user-local path". I'm guessing you mean customization of the Elvish will inherit the |
I've scanned the website and can't seem to find the answer to this. I've also searched for where I should post discussions, but the README doesn't mention anywhere, and CONTRIBUTING.md mentions a user group with no link.
in fish:
in nu:
in xonsh:
My use case is adding Elvish support to https://github.com/bevry/dorothy which will integrate with Elvish by adding itself to the rc script, and loading different config for interactive and login.
The text was updated successfully, but these errors were encountered: