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

[UX] pacman -Syu core update discards bash history #31

Open
1 task done
Artoria2e5 opened this issue Apr 11, 2023 · 3 comments
Open
1 task done

[UX] pacman -Syu core update discards bash history #31

Artoria2e5 opened this issue Apr 11, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Artoria2e5
Copy link

Artoria2e5 commented Apr 11, 2023

Description / Steps to reproduce the issue

  1. Open a Window of MSYS2 MSYS
  2. Do anything to populate bash history
  3. Do pacman -Syu and make sure it's a core update
  4. Do the update
  5. Re-open the window

Expected behavior

I expect the history to be preserved, like with a normal close.

Actual behavior

The close is forced (for good reason) and no history is saved from the session.

Verification

(but you need to wait until it's outdated to reproduce it! oh or just make a fake update tarball.)

Windows Version

MSYS_NT-10.0-22624

Are you willing to submit a PR?

Yes, if we figure out the best way. A possible way is putting this in the default bashrc, but I am not sure it's "graceful" enough (what if it's not a core update? that would change behavior!). It also needs to cover other shells and so on.

pacman() {
  history -a;
  command pacman "$@";
}

Or maybe we make kill_all_other_msys_processes() do a normal sigterm in the MSYS2 context before the taskkill????

@Artoria2e5 Artoria2e5 added the bug Something isn't working label Apr 11, 2023
@lazka lazka transferred this issue from msys2/MSYS2-packages Apr 15, 2023
@lazka
Copy link
Member

lazka commented Apr 15, 2023

Yeah, that's not ideal right now, thanks

@lazka
Copy link
Member

lazka commented Apr 15, 2023

There are a few issues, open questions:

  • bash ignores SIGTERM, so that doesn't work
  • bash allows SIGHUP though (is that a good idea?)
  • Does killing bash kill pacman running in it as well? Otherwise we don't get a chance of sending SIGKILL.

We could special case the parent processes of pacman somehow maybe?

@Artoria2e5
Copy link
Author

Artoria2e5 commented Apr 16, 2023

Does killing bash kill pacman running in it as well

Ho, that's a good one! SIGHUP probably does that. I guess pacman can add a signal (SIGHUP, SIG_IGN); in the core upgrade bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants