Closed OcelotWalrus closed 7 months ago
This terminal mockup is eventually going to be used in the Ren'Py console library made by Elckarow https://github.com/Elckarow/Console I'm not sure if ANSI escapes work with it, I'll ask around and see if that is the case
This terminal mockup is eventually going to be used in the Ren'Py console library made by Elckarow https://github.com/Elckarow/Console I'm not sure if ANSI escapes work with it, I'll ask around and see if that is the case
Well logically no. But it's not obligatory, just a nice addition.
Yeaaaah, I apologise for not making this clear in the readme and docs, I didn't expect any actual contributors to this lmao, I'm going to write up a contributing guide tomorrow
also
okay, so about mv
, here's the thing, right
the ideal case is that i want to make the player able to make their own python scripts and use the functions from the Terminal class like self.touch
or self.write_file
to be able to go about and make changes to their filesystem
when you directly use methods like shutil.move
, it bypasses the checks the terminal class has implemented within itself like
checkxistence(path)
to check if the file actually existslegal(path)
to check if the file is WITHIN the terminal environment, within the root foldervalidated(path)
to check if the file exists AND is legalso that makes it so that if the user doesn't have permissions to write to the target directory, the mv
function you're implementing directly shutil.move(path)
to bypass those checks and directly move the file there
i'm very sorry for not making this clear, this is a small repo, i am new to github in general, and i was not expecting any contributors when i made this repo
I understand, what I've made is not really in the concept of a shell, it's just a terminal prompt. My bad.
This terminal mockup is eventually going to be used in the Ren'Py console library made by Elckarow https://github.com/Elckarow/Console I'm not sure if ANSI escapes work with it, I'll ask around and see if that is the case
As follow up to this, I've discovered the ANSI escapes are indeed not supported by the console lib I was talking about.
I'll make a new PR with the mv
command and my changes to the pwd
command, while respecting what you said sooner:
Yeaaaah, I apologise for not making this clear in the readme and docs, I didn't expect any actual contributors to this lmao, I'm going to write up a contributing guide tomorrow
also okay, so about
mv
, here's the thing, rightthe ideal case is that i want to make the player able to make their own python scripts and use the functions from the Terminal class like
self.touch
orself.write_file
to be able to go about and make changes to their filesystem when you directly use methods likeshutil.move
, it bypasses the checks the terminal class has implemented within itself like1. `checkxistence(path)` to check if the file actually exists 2. `legal(path)` to check if the file is WITHIN the terminal environment, within the root folder 3. `validated(path)` to check if the file exists AND is legal
so that makes it so that if the user doesn't have permissions to write to the target directory, the
mv
function you're implementing directlyshutil.move(path)
to bypass those checks and directly move the file therei'm very sorry for not making this clear, this is a small repo, i am new to github in general, and i was not expecting any contributors when i made this repo
P.-S.: I'm also going to work on the su
command.
This PR changes how the pwd output and how make the
<user>@<machine> <level>
thing bold:I think it's better like that.
This PR now adds the
mv
command and aos.system('clear')
at the beginning of the program.