This is a great question about using variables in your terminal sessions. In Warp, there are a few approaches you can take to store and reuse values like file paths.
Environment Variables in Warp
Warp has a feature called Environment Variables that allows you to save variables and load them into your terminal sessions. Here's how you can use it:
- You can create environment variables through Warp Drive or the Command Palette
- Once created, you can load these variables into your current session with a click
- Then use them in your commands
However, it's important to note that these environment variables aren't automatically loaded when you start a new session - you need to manually load them each time as mentioned in the documentation.
PowerShell Variables
Since you're using PowerShell, you can also set variables directly in your session:
$myPathVariable = "C:\Development\contactable_v5_current\Contactable_2019.sln"
.\srcrep.exe read $myPathVariable
This variable will persist for your current session, but will be lost when you close the session.
For Persistent Variables
If you want these variables to persist across sessions, you have a few options:
- Add them to your PowerShell profile
- Create a Warp Environment Variable as mentioned above and load it when needed
- There's an open feature request (GitHub Issue #5771) to allow managing environment variables locally like workflows, but this isn't implemented yet