* Fix ps command CPU usage on Apple Silicon M1 macs. #4142
The cpu user and system times returned my libproc are not in
nanoseconds; they are in mach ticks units. This is not documented very
well. The convert from mach ticks to ns, the kernel provides a timebase
info function and datatype:
https://developer.apple.com/documentation/driverkit/3433733-mach_timebase_info
The commit makes the PS command work for me.
* Cargo fmt of previous commit.
* Clippy format suggestion
Co-authored-by: Ondrej Baudys <ondrej.baudys@nextgen.net>
* nu-path: use 'linux' code on all non-macOS unix
* nu-command: cfg() the Ps command to platforms it's actually implemented on
* nu-system: cfg() the Ps test to the platforms Ps is implemented on
* Revert "Fix intermittent test crash (#6268)"
This reverts commit 555d9ee763.
* make a working version again
* try second impl
* add
* fmt
* check stdin is atty before acquire stdin
* add libc
* clean comment
* fix typo
* while executing external command, make it as foreground
* remove useless file
* add comment, make var more readable
* add comment
* fmt code
* fix windows
* fix func name
* fix clippy
* fix windows clippy
* add comments, introduce `ForegroundProcess and ForegroundChild
* fix windows clippy
* fix on windows
* no need fg_process_setup module
* Revert "no need fg_process_setup module"
This reverts commit 21ee4ffbf6.
* restrict visibility for helper functions
* Add android as target os for procfs-based ps
* Turn off code for dealing with trash on platforms which are known to not support a standard trash protocol
* Update lib.rs
* Update lib.rs
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
* query command with json, web, xml
* query xml now working
* clippy
* comment out web tests
* Initial work on query web
For now we can query everything except tables
* Support for querying tables
Now we can query multiple tables just like before, now the only thing
missing is the test coverage
* Revert "Query plugin"
* augment `ps -l` on windows to display more info
Co-authored-by: Luccas Mateus de Medeiros Gomes <luccasmmg@gmail.com>