Skip to content Skip to sidebar Skip to footer

How Can I Define .pdbrc On A Windows Machine?

How can I define .pdbrc on my Windows machine? My .pdbrc file: alias sl s;;l alias nl n;;l alias cl c;;l After reading the answer to this question, I tried putting it in C:\Users\

Solution 1:

pdblooks for the HOME system variable which is not defined by default in Windows. You have to define it yourself.

This issue arises because every user in a *nix operating system (Linux, Unix, Darwin, etc.) has a /home directory where they can put run codes like .pdbrc. The path to this directory lives in a system variable (HOME) that applications use to point to a user's personal files. Windows doesn't really have anything like that. The closest analogy to /home on Windows is probably C:\Users\<username>.

Here is how to define a HOME system variable that contains the path C:\Users\<username>. Left click on the startup button and then right click on "Computer" and select "Properties".

Click the startup menu > right click "Computer" > select "Properties"

On the top left, click the "Advanced system settings" link.

Click advanced system settings

This brings up the "System Properties" dialog. On the "Advanced" tab, press the "Environment variables..." button.

Click the "Environment Variables..." button

This brings up the "Environment Variables..." dialog. In the top section for "User variables for <username>", press the "New..." button.

Press "New..." in the User Variables section

For "Variable name:" put "HOME" and for "Variable value:" put C:\Users\<username>.

Enter "HOME" and path to what you want HOME to be

If a HOME variable already exists, just put a semi-colon between whatever is the current value and the new path. When an application uses the HOME variable, it will likely search the contents sequentially. If you want your new path to be found first, put it first in the list.

Hit "Okay" a bunch and then restart whatever application (cmd.exe or otherwise) is running pdb. Make sure that your .pdbrc file is in C:\Users\<username>. When you run pdb again, it should now read your .pdbrc file on startup.

Post a Comment for "How Can I Define .pdbrc On A Windows Machine?"