Repository navigation
In unix like system, set foreground process while running external command - #6206
Conversation
|
oh, wow! wasn't expecting this anytime soon. nice work! this may be one of those things that is ok to not in windows because I'm not positive but I don't think windows supports such a thing. |
sholderbach
left a comment
There was a problem hiding this comment.
I haven't read up on the assumptions/safety requirements of the syscalls used on different platforms, but this API hides potential unsafety behind comments. Either we can locally prove the calls are safe given rust guarantees about the std::process module and document with a safety comment, make them unsafe and document the safe use of those wrappers at the Rust call site (spaghetti code of the relevant function :/ ) or try to build a safe wrapper around that.
sholderbach
left a comment
There was a problem hiding this comment.
Awesome, thanks for the quick changes!
|
Ah shit I forgot about the unused variable problem with |
I love clippy :-D I'll leave to other side If not, the dummy implementation can be removed. |
|
There is a commonly supported ANSI sequence to set the terminal title (crossterm has a windows implementation as well https://docs.rs/crossterm/latest/crossterm/terminal/struct.SetTitle.html), that might be helpful to do it manually instead of relying on the process detection |
|
I think terminal title is different to something mentioned in #6156 . But setting terminal title would also be interesting, thanks for your tip :-D |
|
@sholderbach @WindSoilder Keep in mind, if you decide to start changing the window/tab title that you are now encroaching on the shell_integration changes, which is fine, but one of these title setting things may overwrite the other. You may just want to set the process stuff for now and deal with the title in a separate PR if needbe. |
|
Right, yeah let's land this PR first. |
|
It works; thank you @WindSoilder! |
Description
Closes: #6156 #3861
Screenshots:
Hi, @rosshadden, would you please check if the implementation suited for your need? I'm not really confident with the implementation because it's really tricky to me :-( I've just do manually testing and it seems ok to me.
Tests
Make sure you've done the following:
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspace --features=extrato check that all the tests pass