Fish Shell: "error: Unable to open universal variable file '/': Permission denied" [closed] - fish

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I am using the Fish shell (version 3.3.1) on MacOS. Every time I run a command it shows this error multiple times:
error: Unable to open universal variable file '/': Permission denied
The commands still run perfectly, but it's very annoying to see these errors. They are still on the screen even after a clear command.

Fish has a feature where it'll store so called "universal" variables to a file on disk, so they can easily be persisted and shared among open fishes.
This error:
error: Unable to open universal variable file '/': Permission denied
Shows that fish is trying to open the file at "/", the root of the filesystem. This points to a misconfiguration, because "/" isn't a file, by definition. It's a directory.
The file is supposed to be in the config directory, which is at:
$XDG_CONFIG_HOME/fish, if that variable is set
$HOME/.config/fish, if it isn't
I can't find the specific sequence to reproduce this, but it appears that $XDG_CONFIG_HOME or $HOME are set when fish is started (by its parent process, probably the terminal), and to non-functional values.

Was having this same issue after installing using brew install fish.
What finally worked was uninstalling fish.
brew uninstall fish
Then removing fish from my .config folder.
cd ~
rm -rf .config/fish
Then I just installed fish using the fish GUI installer.

Related

bash: flutter: command not found [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
Flutter doctor command doesn't work on Visual studio Code terminal?
flutter doctor work on terminal full path but dose not work on VS code terminal or another path on pc?
You need restart your computer after edit environment path
You need to have each path on separate line. That's what I have.
click NEW and then enter your path like below
C:\src\flutter\bin
Then restart
Edit: I would suggest you add your git and all the other paths also on separate line. you should be very careful with environment variables.

I can't delete folders inside WSL which I accidentally created through Windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
Improve this question
I have WSL with a directory ~/library created within WSL. Then I ran VSCode and opened this folder directly from Windows Explorer, causing to open it as a "local Windows" folder instead of WSL. Adding to the offense, I created 2 folders from VSCode (let's say foo and bar) inside library.
The cost of doing this is that now I can't delete these folders, either from Windows Explorer or WSL (sudo rmdir foo or sudo rm -rf foo). In Windows and Ubuntu I'm getting access denied errors. I am both Windows admin and root user.
Would be any workaround for removing them?
Maybe a little too late but to remove folder in your wsl just open your wsl/ubuntu terminal. cd /to get to your root. ls to find where you created the folder, in my case it was in: home/user/projects folder, cd home/user/projects. Type this command: rm -r folder-name, then ls to verify that the folder has been remove.

Share folder between Windows and WSL [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 23 days ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am using XMing to run Emacs from WSL, which is working quite well. My issue is when trying to share folders between Windows and WSL. I have tried the following:
Project located in the Windows file system, accessed via /mnt/ in WSL
Symlink (created in WSL bash) of project located in the Windows file system
Copy the project to the WSL file system
Out of the 3 listed options, only the last works with projectile (and likely other Emacs packages). But I need to be able to access/modify the files from Windows as well, so that is not a viable option.
Has anyone found a good solution for this?
I do it so (also to sync between Windows_laptop & Ubuntu_pc):
I have folder "workspace"
and symlinks to it: windows symlink under win and linux symlink under linux.
%USERPROFILE%\Cloud\workspace
for Win usage:
made windows symlink: %USERPROFILE%\workspace -> %USERPROFILE%\Cloud\workspace
for Ubuntu usage (WSL):
made linux symlink: ~/workspace -> /mnt/C/Users/USER/Cloud/workspace
May this help?
One of the advantages of WSL (windows subsystem for Linux) is that you can share files easily with your windows.
I have used the below codes with WSL Ubuntu (but this should work with other versions of Linux as well). Using /mnt will do all the magic.
Syntax:- cd /mnt/drive/Folder/Subfolder
Sample code:- cd /mnt/c/Users/Saswat

How to disable vim commands in vimrc to secure vim [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to disable the 'r' and 'o' commands in vim so people who use it can't open other files from within vim.
I tried to use the cmap r <Nop> and cmap o <Nop>, which work but have an undesirable side-effect... those 2 letters can never be used in vim command line nor when searching for something...
If you try to search for the word, "word" the search line displays: /wd.
So is there another way to disable opening files from with vimrc ?
If you really want to secure Vim (and not just provide a superficial appearance of certain disallowed features), you have to remove those features from the source code and compile (and test!) a limited version of Vim. (Or maybe you can use a operating-system wrapper that sandboxes the Vim process and filters certain system calls, but I don't know any such thing.)
Any Vimscript obstruction can be circumvented: Your remappings can be undone via :cunmap, any more elaborate protection in Vimscript can be stopped by pressing <C-c> at the right time.
You can launch Vim with a flag:
$ vim -R (readonly)
$ vim -Z (restricted)
$ vim -m (no writing)
$ vim -M (no text modification)
But none of those will block :e or :r or any of the myriad of similar commands. And… the ~/.vimrc could probably be edited with nano or whatever to remove any eventual command anyway.
What about completely sandboxing Vim or its user?
What about explaining why you would want that?
If you want to allow editing of a specific file with root permissions, without allowing commands or editing of other files (as you've now indicated in a separate comment), why don't you do this as outlined in man 8 sudoedit:
Temporary copies are made of the files to be edited
with the owner set to the invoking user.
The editor specified by the policy is run to edit the
temporary files. The sudoers policy uses the
SUDO_EDITOR, VISUAL and EDITOR environment variables
(in that order). If none of SUDO_EDITOR, VISUAL or
EDITOR are set, the first program listed in the editor
sudoers(5) option is used.
If they have been modified, the temporary files are
copied back to their original location and the
temporary versions are removed.
It is much safer to launch the editor in the user's context, not root context. (Plus, the user get's his Vim settings, not the unmaintained ones from the root account!) Just the sync back of the edited temp file must be done with root priviledges; with the help of sudo, all of this can be implemented in a few lines of shell script.

How to open a file in the Mac version of Eclipse? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Goal: Under OSX, From the command line, open a file in eclipse.
Environment:
OSX 10.7
Eclipse Indigo Java EE bundle (3.7.1)
Expectation:
cd to directory eclipse is installed from.
run:
./eclipse --launcher.openFile notice.html
Eclipse opens with the file 'notice.html' open/editable
What happens:
Eclipse opens but the file isn't loaded. :(
I explicitly want to do this from the command line, I'm NOT interested in opening the file via Finder->Open With->Choose Eclipse.app
Here is an article that seems to indicate that I should be able to do this:
http://aniefer.blogspot.com/2010/05/opening-files-in-eclipse-from-command.html
If there is another way to communicate with an already open eclipse to open a file that would be acceptable as well.
Eventually I'd like to use:
open //path-to-Eclipse.app --args --launcher.openFile //path-to-file
...to communicate my desire for the file to open in the current instance of the running eclipse.
But for now I'm just trying to see if there is ANY way to open a file
Anyone have any ideas?
Thanks in advance for any help/pointers :)
I agree with Bavarious. I always use open -a to open a specific file in a GUI app from the command line.