简体   繁体   English

FISH:如何在发射鱼时设置特定的 $fish_function_path?

[英]FISH: How to set a specific $fish_function_path while launching fish?

I'm trying to use the sshrc to execute fish with my own defined functions at the remote server.我正在尝试使用sshrc在远程服务器上使用我自己定义的函数执行fish

I know there is a $fish_function_path variable that I can modify to prepend my custom path with my functions, but this variable seems global and I don't want to affect other fish users.我知道有一个$fish_function_path变量,我可以修改它以在我的函数前面添加自定义路径,但是这个变量似乎是全局的,我不想影响其他fish用户。

Is there any way to change this variable only for my single fish session or any other ways to use my fish functions only for a single session?有什么方法可以只为我的单个鱼会话更改此变量,或者任何其他方法仅在单个会话中使用我的鱼函数?

I have also tried setting and environment variable from the outer shell: fish_functions_path="$MY_FUNCTIONS_PATH" fish but it seems environment variables don't affect those inner variables of fish.我也尝试fish_functions_path="$MY_FUNCTIONS_PATH" fish外壳设置和环境变量: fish_functions_path="$MY_FUNCTIONS_PATH" fish但似乎环境变量不会影响 fish 的那些内部变量。

Used this docs .使用了这个文档

Thanks!谢谢!

Global variables, including $fish_function_path , are per-session.全局变量,包括$fish_function_path ,是每个会话的。 You might be thinking of universal variables, which are shared across sessions for a given user.您可能正在考虑通用变量,这些变量在给定用户的会话之间共享。

It should be fine to modify $fish_function_path for a given instance of fish - it won't affect any others.为给定的鱼实例修改$fish_function_path应该没问题 - 它不会影响任何其他实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM