Skip to content
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

Refactor CRC shell detection mechanism to use process parent programatically #4562

Open
2 tasks
rohanKanojia opened this issue Jan 9, 2025 · 1 comment
Open
2 tasks
Assignees

Comments

@rohanKanojia
Copy link
Contributor

rohanKanojia commented Jan 9, 2025

Description

Originally posted by @cfergeau in #4526 (comment)

If we want to do some more extensive shell guessing by iterating over processes, could we not limit ourselves to the parents of the crc process?
I'd prefer that we extend this approach and drop the calls to an external command, and the parsing which comes with it.
In the scenario described above on macos, with pstree I get this so I can find the right terminal without relying on "latest launched"
(I'm not suggesting to use pstree directly, but to do something similar in go)

Acceptance Criteria

  • Investigate whether shell can be detected correctly using parent process approach programmatically without using any command
  • If investigation is successful , refactor current shell detection mechanism to be based on this approach.
@cfergeau
Copy link
Contributor

cfergeau commented Jan 9, 2025

I'd summarize this as

getNameAndItsPpid may not have the behaviour we want now, but can it be fixed to do what we need? Imo, this is what we want to do, start from the current process, and look at the process names/command lines until one is a shell process.

@rohanKanojia rohanKanojia changed the title Refactor CRC shell detection mechanism to use process parent programattically Refactor CRC shell detection mechanism to use process parent programatically Jan 9, 2025
@rohanKanojia rohanKanojia self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants