searleser97 / cpbooster

Competitive Programming Booster
GNU General Public License v3.0
144 stars 30 forks source link

Open the editor right after creating a new file or place the terminal in the correct directory #110

Closed leonardo-delfino closed 6 months ago

leonardo-delfino commented 7 months ago

After creating a new file with cpb create, it is opened with the selected editor (or, if it's a terminal, the terminal is opened in the path of the new created file).

searleser97 commented 7 months ago

So the intention of this PR is to have similar behavior to cpb clone but when doing cpb create ?

leonardo-delfino commented 7 months ago

When using cpb create, the tool just creates the file/s. As stated in the README, it would be a good thing to directly open them just right after the creation. The thing is that if gnome-terminal is used as editor, it would not be possible to edit it directly (as it is not an editor). So, in the case of terminals (konsole, gnome-terminal, etc) it would just open the path in which the files have been created.

leonardo-delfino commented 7 months ago

So the intention of this PR is to have similar behavior to cpb clone but when doing cpb create ?

Yes, this makes it possible to open a file right after creating it, doing something similar to the cpb clone. The separate EditorCommandBuild is needed because of multiple files, and because of terminals (using an editor, it's better to open the file / files directly, but using a terminal that is not possible so I just need to open it in the directory in which the file/s have been created). The flag openTerminal makes not that much sense alone here, but it permits to not open N instances of terminals where N is the number of parsed problems. I've found a fix for the Windows WSL bug not downloading the whole problemset, but I'll create a separate PR for that.

searleser97 commented 6 months ago

Excited to see the fix for Windows WSL, thanks