-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command to show current pokemon #38
Comments
There used to be a function What if the name of the Pokemon is printed to the terminal each time the
Do you think that would be a good solution? |
Yeah, I think that would help |
I believe I've accomplished what you're discussing. I'll try to make a version of the |
Hey guys, |
It struck me the other day, this shouldn't actually be a difficult issue; you can do this without binding it to one terminal or another simply by setting the current pokemon as an env var in your current terminal window when you set it. Also, being able to reliably determine the current pokemon in your window could pave the way for other cool features, like "pokemon evolve" -> swap to evolved form of current pokemon. |
I mean I was struggling with this issue too, you cant set an environment variable from a child process, e.g. python interpreter. What I ended up doing was implementing a FIFO pipe to communicate. But I just realized, that is single process only. I had a huge epiphany when writing this, /tmp is cleared on boot, so we can save a 'current sessions' (maybe JSON?) database there! Summing that up with the fact that PID's are seldom re-utilized (and we can save process name just to be sure), I think it's a trustworthy system enough, what do you guys think? |
What about using PID and starttime in Unix Epoch? This would make the temporary file easier to parse and write to, as well as being simple plaintext since we don't have to escape possibly user-generated strings (the process name) and a better guarantee on the process being the same than the one we saved in /tmp:
where the format is |
Another epiphany, we don't need to keep a global database file, there is no point, pokemon processes don't care about each other, so we can simply keep a pid-named file on tmp, e.g. And we don't need to care about if the PID is going to be re-utilized later because the only PID we will be checking is the current bash session's PID (environment variable |
Looks good to me, however I would also separate by user, like this: |
Just submitted #148 which I think is a nice solution for this |
guys, any progress? |
I'm less familiar with the Pokemon in the more recent regions, and don't always recognize them right away from the image. Is there an easy way to tell which Pokemon is currently being featured?
The text was updated successfully, but these errors were encountered: