Hello, when using windows I can change the directory that PC-BASIC starts up in by changing the shortcut properties that I use to start it, but under linux I am not sure how to change the current directory on startup so I don't have to typr chdir "basic" every time I start the program since I tend to forget to do it.
Thanks,
Daniel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok I found a solution, but it may not be the best. I just created a launcher to point to a shell script, then in that script I changed directory and called pcbasic. I had to update filename references in pcbasic.ini because the current directory was changed, but it worked.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Daniel, to be honest, changing a program's working directory is not something I've often tried to do in Linux. Your shell script solution seems workable. Other ways would depend on the details of your desktop environment so you may need to consult their documentation.
I don't know the details of your use case - however, if you're doing this mainly in order to change where files are saved/loaded, then an easier way is to change the mount point for PC-BASIC's Z: drive with the mount= option in PCBASIC.INI (see http://robhagemans.github.io/pcbasic/doc/#--mount)
For example, if your BASIC files are always under /home/me/basic you'd include the following line in PCBASIC.INI:
mount=Z:/home/me/basic
Hope this helps,
Rob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, yes, that's why I was trying to change the current dir. I wanted the basic programs in a different directory than my home folder. Thanks for the advice!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, when using windows I can change the directory that PC-BASIC starts up in by changing the shortcut properties that I use to start it, but under linux I am not sure how to change the current directory on startup so I don't have to typr chdir "basic" every time I start the program since I tend to forget to do it.
Thanks,
Daniel
Ok I found a solution, but it may not be the best. I just created a launcher to point to a shell script, then in that script I changed directory and called pcbasic. I had to update filename references in pcbasic.ini because the current directory was changed, but it worked.
Hi Daniel, to be honest, changing a program's working directory is not something I've often tried to do in Linux. Your shell script solution seems workable. Other ways would depend on the details of your desktop environment so you may need to consult their documentation.
I don't know the details of your use case - however, if you're doing this mainly in order to change where files are saved/loaded, then an easier way is to change the mount point for PC-BASIC's
Z:
drive with themount=
option inPCBASIC.INI
(see http://robhagemans.github.io/pcbasic/doc/#--mount)For example, if your BASIC files are always under
/home/me/basic
you'd include the following line inPCBASIC.INI
:Hope this helps,
Rob
Actually, yes, that's why I was trying to change the current dir. I wanted the basic programs in a different directory than my home folder. Thanks for the advice!