Coder Social home page Coder Social logo

fkill-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fkill-cli's Issues

Kill one process per run

it's kind of annoying that I have to hit esc after killing a process

I want to type fkill, find my process, hit enter, and get back to my shell

Question - the GIF recorder

Hi,

You have a very beautiful GIF in your README file. Mind sharing what is the tool name you used to record and save that GIF? ๐Ÿ™‚

Thank you.

Interactive search

Would be nice to be able to quickly search for a process when in interactive mode.

Let's say I want to find the Notes.app. I just start typing: No and it will start filtering down the results.

Search by port

It'd be great if it's possible to also search by a port being open by a process

Use process cmd from ps-list (instead of/with) the name

I think it would be easer to find a process if the full command is used instead of the name.
Indeed, if i have couple of node process running in background, i will have

node 1337
node 1338
node 1339

but if the full command is displayed

node foo.js 1337
node bar.js 1338
node foo-bar.js 1339

an other display could be

node 1337 `node foo.js`
node 1338 `node bar.js`
node 1339 `node foo-bar.js`

Better process naming

When i'm trying to kill my app node server, i'm looking for node and i get this:
screen shot 2017-03-05 at 12 38 36 pm

but how can i choose the correct one when all of them with the same name?

Escape key?

Perhaps there should be a key handler for an escape key. I mean, control + c works, but I think there should be something more graceful, such as also adding support for q, similar to less and top.

Otherwise, love it!

README screenshot....too fast?

This is just an observation/my opinion, so take it with a grain of salt. I love the idea of fkill, great work!

When I was first looking at the README, the animated demo caught my eye quick and was a nice, concise demo of what fkill is supposed to do. However, the animation seemed wayyyy to fast and it was a bit hard to follow exactly what was going on. While I could eventually piece it together, I wonder if a more "real time" speed to the gif would be more "accessible" to someone viewing it.

I think the primary thing that feels to fast is the secondary action of typing in the "auto-complete" (after fkill fires up and shows results). Maybe just delay for a second at startup to show the list of running processes, then type each character in the autocomplete slower?

I dunno, just some (hopefully) constructive feedback.

Warning of unmet peer dependency: inquirer

Having an issue resolving this warning of an unmet peer dependency when installing globally:

$ npm install -g fkill-cli inquirer@^6.0.0
/usr/local/bin/fkill -> /usr/local/lib/node_modules/fkill-cli/cli.js
npm WARN [email protected] requires a peer of inquirer@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.

+ [email protected]
+ [email protected]
added 184 packages from 67 contributors in 6.88s

unexpected identifier on first install

I'm sure this is just some node.js mismatch but just wanted to let you know that after running

npm install --global fkill-cli

then on first run of fkill I get:

/usr/local/lib/node_modules/fkill-cli/cli.js:86
const handleFkillError = async processes => {
                               ^^^^^^^^^
SyntaxError: Unexpected identifier
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:513:28)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3

Show context

Either the path or full command for the running process. This helps differentiate between two or more processes with the same name.

This could be a flag, like fkill --detailed.

Interactive CLI

Would be nice to have an interactive CLI when it's run without arguments.

The user would be presented with a list of process and can easily go up and down then hit enter to kill one.

Can be implemented using Inquirer.js.

Similar example from yo:

screen shot 2013-10-19 at 1 44 14 am

Should look something like this:

โฏ Process1  24241
  Process2  24242
  Process3  24243

With the number being the PID and chalk.dim().
Sorted by PID.

The terminal interface

Hello,

I saw u got a nice terminal interface in README, I really love it.
Would u mind tell me what u theme is or tool is?.

Thanks ~

Cannot install on Ubuntu

I try to install on Ubuntu 18.10 and have errors:

npm install --global fkill-cli
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
npm WARN checkPermissions Missing write access to /usr/local/lib
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! stack: 'Error: EACCES: permission denied, access '/usr/local/lib'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/przemek/.npm/_logs/2018-11-07T09_48_04_973Z-debug.log

Feature: Show CPU/mem usage

Issuehunt badges

Will be cool to see CPU/mem usage as often a lot of same processes running with same name.

Will be cool to distinguish them.


IssueHunt Summary

stroncium stroncium has been rewarded.

Backers (Total: $60.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Smart mode

Issuehunt badges

Currently there's a lot of useless processes in interactive mode that I would never care to close. Like all the Chrome helper processes. These makes it harder to find processes I actually want to close. With some simple heuristics I think we could hide away most of those useless processes.

Should smart mode be default when using the interactive UI?

What processes needs hiding?

  • Google Chrome Helper (done)
  • 2BUA8C4S2C.com.agilebits.onepassword-osx-helper
  • -zsh

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

No way to specify signal to send

Is there a way to specify the signal to send to the process?

I understand that fkill is multi-platform but at least in Unix environment people regularly use both TERM and KILL, and possibly others like HUP

Special case `fkill help`?

Yesterday I had a fun time when I wanted to see the usage for fkill and typed fkill help. oh boy! havoc! it very successfully killed all "helper" processes: slack, atom, chrome, etc were all nuked. Wasn't a huge deal, but I wonder what you think of special casing fkill help to help prevent this for others.

I'm happy to work on a PR for this!

fkill crashes on Node v8.17.0

Error Stack:

/Users/g.v.sandeep/.nvm/versions/node/v8.17.0/lib/node_modules/fkill-cli/node_modules/fkill/node_modules/ps-list/index.js:80
const psOutputRegex = /^[ \t]*(?<pid>\d+)[ \t]+(?<ppid>\d+)[ \t]+(?<uid>\d+)[ \t]+(?<cpu>\d+\.\d+)[ \t]+(?<memory>\d+\.\d+)[ \t]+/;
                      ^

SyntaxError: Invalid regular expression: /^[ \t]*(?<pid>\d+)[ \t]+(?<ppid>\d+)[ \t]+(?<uid>\d+)[ \t]+(?<cpu>\d+\.\d+)[ \t]+(?<memory>\d+\.\d+)[ \t]+/: Invalid group
    at Object.<anonymous> (/Users/g.v.sandeep/.nvm/versions/node/v8.17.0/lib/node_modules/fkill-cli/node_modules/fkill/node_modules/ps-list/index.js:80:23)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/g.v.sandeep/.nvm/versions/node/v8.17.0/lib/node_modules/fkill-cli/node_modules/fkill/index.js:8:16)
    at Module._compile (module.js:653:30)

Steps to Reproduce:
Run any fkill command.

v6.0.0 interactive mode not launching on Windows

Version 6.0.0 (latest) not launching interactive mode on Windows.

Steps to reproduce:

>npm --global install fkill-cli
+ [email protected]
added 155 packages from 67 contributors in 3.904s

>fkill
TypeError: Expected a number
    at assertNumber (\AppData\Roaming\npm\node_modules\fkill-cli\node_modules\num-sort\index.js:5:9)
    at Object.exports.descending (AppData\Roaming\npm\node_modules\fkill-cli\node_modules\num-sort\index.js:16:2)
    at preferHighPerformanceImpact (\AppData\Roaming\npm\node_modules\fkill-cli\interactive.js:32:55)
    at preferHeurisicallyInterestingProcesses (\AppData\Roaming\npm\node_modules\fkill-cli\interactive.js:43:11)
    at Array.sort (<anonymous>)
    at filterProcesses (\AppData\Roaming\npm\node_modules\fkill-cli\interactive.js:67:4)
    at Object.source (\AppData\Roaming\npm\node_modules\fkill-cli\interactive.js:123:37)
    at AutocompletePrompt.search (\AppData\Roaming\npm\node_modules\fkill-cli\node_modules\inquirer-autocomplete-prompt\index.js:177:32)
    at AutocompletePrompt._run (\AppData\Roaming\npm\node_modules\fkill-cli\node_modules\inquirer-autocomplete-prompt\index.js:65:10)
    at \AppData\Roaming\npm\node_modules\fkill-cli\node_modules\inquirer\lib\prompts\base.js:57:12

When installing v5.2.0, all works as expected:

>npm --global uninstall fkill-cli
removed 155 packages in 1.251s

>npm --global install [email protected]
+ [email protected]
added 148 packages from 72 contributors in 8.038s

>fkill
? Running processes: (Use arrow keys or type to search)
> System Idle Process 0 :57519 :57521 :57522 :57523
  System 4 :445 :9009 :50160 :139
  Secure System 72
  svchost.exe 96
  svchost.exe 104
  lsass.exe 112
  Registry 144
  smss.exe 532
  SearchProtocolHost.exe 712
  browser_broker.exe 808
(Move up and down to reveal more choices)

Other versions:

>node -v
v13.9.0

>npm -v
6.13.7

PATH

I installed it following instructions, and it was installed in /usr/local/Cellar/node/8.9.1/bin/fkill. I don't have this into my PATH variable, should I add it or did I do something wrong?

SyntaxError: Invalid regular expression

I just installed the fkill and got an error SyntaxError: Invalid regular expression: /^[ \t]*(?<pid>\d+)[ \t]+(?<ppid>\d+)[ \t]+(?<uid>\d+)[ \t]+(?<cpu>\d+\.\d+)[ \t]+(?<memory>\d+\.\d+)[ \t]+/: Invalid group

MacOS Catalina 10.15.4
npm version 5.6.0, after updating to 6.14.8 got still same error
shell (if important, I don't know) zsh 5.4.2 (x86_64-apple-darwin17.3.0)

โฏ npm install --global fkill-cli
/usr/local/bin/fkill -> /usr/local/lib/node_modules/fkill-cli/cli.js
+ [email protected]
added 143 packages in 17.179s

โฏ fkill
/usr/local/lib/node_modules/fkill-cli/node_modules/fkill/node_modules/ps-list/index.js:80
const psOutputRegex = /^[ \t]*(?<pid>\d+)[ \t]+(?<ppid>\d+)[ \t]+(?<uid>\d+)[ \t]+(?<cpu>\d+\.\d+)[ \t]+(?<memory>\d+\.\d+)[ \t]+/;
                      ^

SyntaxError: Invalid regular expression: /^[ \t]*(?<pid>\d+)[ \t]+(?<ppid>\d+)[ \t]+(?<uid>\d+)[ \t]+(?<cpu>\d+\.\d+)[ \t]+(?<memory>\d+\.\d+)[ \t]+/: Invalid group
    at Object.<anonymous> (/usr/local/lib/node_modules/fkill-cli/node_modules/fkill/node_modules/ps-list/index.js:80:23)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/fkill-cli/node_modules/fkill/index.js:8:16)
    at Module._compile (module.js:662:30)

I'm not a JS developer, so have no idea how can I help in debugging the issue

Error: spawn netstat ENOENT

Hi, fkill command does not respond to my situation and after control+c it shows that error message;

Error: spawn netstat ENOENT
    at exports._errnoException (util.js:870:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:441:9)
    at process._tickCallback (node.js:355:17)
    at Function.Module.runMain (module.js:444:11)
    at startup (node.js:136:18)
    at node.js:966:3

OS: Ubuntu 16.04.4 LTS
Npm: 3.5.2
Node: v4.2.6

And then I realized missing netstat.

I installed netstat using apt-get install net-tools

It works fine! ๐Ÿ‘

Combining --force and --silent

Issuehunt badges

We need to kill a node process that runs a server (e.g. on port 8000) as part of our deployment script.

Using "fkill :8000" doesn't terminate the process, so we need "fkill -f :8000"

Unfortunately, fkill is returning an error code when there is no process running on port 8000. So we added the silent switch "fkill -f -s :8000"

This works, but gives an error message when no process has been found, which should not be the case using -s.


IssueHunt Summary

ulken ulken has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Forcefull termination

I just tried out fkill and the first process I tried to kill resulted in an error... ๐Ÿ˜บ In this particular case, I was trying to kill a process that apparently needed to be "terminated forcefully" (see the output below). Maybe in these cases, fkill presents a secondary challenge to the terminal like "Are you sure you want to kill this process?" and then forcefully terminate upon yes, or cancel upon no. Or maybe you don't want to allow the ability to forcefully terminate, in which a friendlier error message would probably suffice.

Just wanted to highlight the issue!

P.S. for what its worth, I'm on Windows 7, currently using a git-bash flavored shell, node 6.2.1.

$ fkill
? Running processes: cnt
? Running processes: cntlm.exe 2200

AggregateError:
    Error: Killing process 2200 failed: ERROR: The process with PID 2200 could not be terminated.
    Reason: This process can only be terminated forcefully (with /F option).
        at Promise.all.then (C:/Users/********/AppData/Roaming/nvm/v6.2.1/node_modules/fkill-cli/node_modules/fkill/index.js:41:10)
    at AggregateError (C:\Users\********\AppData\Roaming\nvm\v6.2.1\node_modules\fkill-cli\node_modules\aggregate-error\index.js:19:3)
    at Promise.all.then (C:\Users\********\AppData\Roaming\nvm\v6.2.1\node_modules\fkill-cli\node_modules\fkill\index.js:41:10)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Pathing on OSX

Is /usr/local/lib expected to be in the user's path?

~ ยป npm install -g fkill
/usr/local/lib
โ””โ”€โ”€ [email protected]

~ ยป which fkill

Possible memory leak

I installed this and killed some processes and later my whole system ran out of application memory which has never happened.

I tried it again and got this message:
Running processes: (Use arrow keys or type to search)(node:6415) Warning: Possible EventEmitter memory leak detected. 11 keypress listeners added. Use emitter.setMaxListeners() to increase limit

Not sure exactly the cause but this was the only new software on my machine.

Kill all

Issuehunt badges

I currently have to run fkill about 5 times when I search for python. It would be nice if I could somehow request either:

Kill all exact matches
Kill all visible, suggested processes on my screen

Do others have a need for this? (:thumbsup:)
Maintainers interested in a PR?

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

how to close properly?

Awesome stuff.

But Ctrl + C on my Mac leaves a residue of the fkill interface (which can only be cleared if I issue new commands or hit Enter for a few times to clear all those lines).

how to close fkill properly?

Aggregate Error in mac os HighSierra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.