The pseudoterminal that Fig spawns in the background when you open up
autocomplete is only initially sourced with minimal environment variables (mainly just your
scripts that are run from a completion spec rely on these
environment variables. for example the AWS completion spec uses the AWS CLI. The
AWS CLI relies on environment variables like
AWS_ACCESS_KEY_ID etc (see
There are two ways:
This file is sourced by the pseudoterminal every time autocomplete is loaded. Add your environment variables to the
ptyrcfile like this:
export MY_VARIABLE="hello world"
Add items to your pty.env fig setting:
fig settings pty.env '["LESS","OLDPWD","AWS"]'
The pty.env setting takes a JSON array of strings.
fig source, Fig will source all environment variables in your current shell session that match the environment variables you have set in your pty.env setting. It will also match all environment variables that share a prefix with a string in your Fig settings.
For example, if my pty.env setting was
'["AWS"]', then after running Fig source, all local environment variables starting with AWS (for example
AWS_DEFAULT_REGIONetc) will be set in Fig's pseudoterminal.
Note: Again, you must run
fig sourcemanually each time you want to set environment variables using this method. Fig does not know any of your environment variables exist unless you've added it to your
ptyrcfile or it's in your pty.env setting and you run
fig source. We are exploring ways of doing this is more streamlined.
When your pseudoterminal spawns, Fig also sources this
~/.fig/tools/ptyrc. However, this is overridden by the Fig team on every
update. You can see this file and make changes in the withfig/config repo