Comments (12)
Absolutely, go ahead!
I await the improvements your pull request will bring :)
from macchina.
You'll have to manually traverse /proc
and compare the values of /proc/<TERMPID>/comm
and /proc/<TERMPID>/cmdline
.
cmdline
should hopefully show you an output like the one returned by the ps
command you mentioned.
If it does, and you think the output of cmdline
is more consistent, I'd be happy to include the change.
from macchina.
Thank you, I'll review it as soon as possible :)
from macchina.
The current implementation parses /proc
to determine the most likely
terminal, but it does so through the /proc/PID/comm
file which we
have no way of saniziting.
$TERM
has proven to be unreliable at detecting the real terminal
being used (anyone can for example set the variable to xterm
and
that would then be reflected in macchina).
$TERMINFO
is new to me, I've never had to directly interact with it.
I believe we're better off returning the relevant terminfo description
directly.
from macchina.
The current implementation parses
/proc
to determine the most likely terminal, but it does so through the/proc/PID/comm
file which we have no way of saniziting.
Ah makes sense
$TERM
has proven to be unreliable at detecting the real terminal being used (anyone can for example set the variable toxterm
and that would then be reflected in macchina).
Thats true, I have seen that done a lot
$TERMINFO
is new to me, I've never had to directly interact with it.I believe we're better off returning the relevant terminfo description directly.
Yeah, I agree, idk if this helps but I found a crate that could aid in this https://crates.io/crates/terminfo
from macchina.
Yeah, I agree, idk if this helps but I found a crate that could aid in this https://crates.io/crates/terminfo
Yeah it looks like it will, I was never really a fan of our little procfs hack.
from macchina.
Yeah, I agree, idk if this helps but I found a crate that could aid in this crates.io/crates/terminfo
Yeah it looks like it will, I was never really a fan of our little procfs hack.
Oh yeah definitely seems pretty hacky
from macchina.
@grtcdr If you'd like I can write up something with this, just wanna know in case someone has already started on this.
from macchina.
Absolutely, go ahead!
I await the improvements your pull request will bring :)
After implementing terminfo, it seem futile, same issue as with $TERM
from macchina.
I found this result on stackoverflow that uses ps -o 'cmd=' -p $(ps -o 'ppid=' -p $$)
to get the term name, which results in something like this
could the path then be stripped to only get exec name, as this method seems to use the exact exec name
from macchina.
Okay, so it sorta works. I mean it does, but when its in a nix-shell it says rc
, which happens to be the exec name of nix shells. I'm quite sad, because I kept getting rc
, and was very confused until i just ran ps, and it also said rc
I'll make the pr now
from macchina.
I've made a PR now! Macchina-CLI/libmacchina#130
from macchina.
Related Issues (20)
- [BUG] Typo in build instructions provided in wiki HOT 4
- How to insert a blank line before the key-values? HOT 10
- Modifying keys does nothing on macOS HOT 7
- Compile error, possibly two tui versions? HOT 34
- [BUG] Macchina 6.1.4 doesn't report version when running macchina --version HOT 1
- [BUG] Brew packages are displayed +1 HOT 7
- [BUG] Crashes on FreeBSD 13 HOT 8
- [BUG] Fails to build on Ubutnu HOT 19
- [BUG] Custom theme not being used HOT 3
- [BUG] Invalid variant: OperatingSystem HOT 10
- [BUG] Proxmox VE is shown to be debian HOT 7
- [BUG] Crashes on cpu model "Intel Core i7 9xx (Nehalem Core i7, IBRS update)" HOT 7
- [feature request] Display total RAM memory in GB HOT 2
- Possible improvement to memory readout HOT 6
- [BUG] WSL2 openSUSE Tumbleweed zypper packages didn't show up HOT 4
- [Feature Request] More standard and versioned release artifacts on github
- Accept disk path(s) to display usage of specified disk / multiple disks
- [BUG] Build failed with libgit2 1.6.4 on Arch Linux HOT 2
- [BUG] Fails to build with ratatui HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macchina.