github icon indicating copy to clipboard operation
github copied to clipboard

Unstaged & Staged Changes tabs no longer autoclose after staging and commit

Open kryten87 opened this issue 7 years ago • 7 comments

Prerequisites

  • Have you tried to reproduce the problem in [Safe Mode][safe-mode]? Yes
  • Have you followed all applicable steps in the [debugging guide][debugging-guide]? Yes
  • Have you checked the FAQs on the [message board][message-board] for common solutions? Yes
  • Have you checked that your issue [isn't already filed][already-filed]? Yes

Description

I recently upgraded to address a different issue and found that the behaviour of the "Unstaged Changes" and "Staged Changes" tabs has changed.

I've come across a number of issues which may be related (see #1160 and #391 in particular), but none seem to address this change, which appears to have come about recently. I've also searched for a change log, but I can't find one in this repository.

Steps to Reproduce

Here's what I do and what I'm seeing:

  1. edit a file & save it
    • the file appears in the "Unstaged Changes" section of the Git Tab
  2. double-click the file in the "Unstaged Changes" section
    • a new tab opens in the editor with the title "Unstaged Changes: path/to/file". It briefly contains the list of unstaged changes, then changes to "File has no contents"
    • the file appears in the "Staged Changes" section of the Git Tab.
    • Expectations I expect the "Unstaged Changes: path/to/file" tab to close. This is what it used to do. Instead, I have to manually close the tab.
  3. click the file in the "Stage Changes" section of the Git Tab
    • the "Unstaged Changes" tab changes to "Staged Changes: path/to file". It contains the staged changes.
  4. add a commit message and press Ctrl-Enter to commit the change
    • *the "Staged Changes: path/to/file" tab becomes empty - it now says "File has no contents"
    • Expectations I expect the "Staged Changes: path/to/file" tab to close. This is what it used to do. Instead, I have to manually close the tab.

Reproduces how often:

This happens whenever I attempt to commit when using this version of Atom.

Versions

OS: Kubuntu 14.04.4

Output of atom --version:

Atom    : 1.23.3
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0

Output of apm list:

Built-in Atom Packages (92)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Community Packages (16) /home/dthomas/.atom/packages
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

kryten87 avatar Jan 15 '18 18:01 kryten87

I would love to have this feature, it's quite annoying and interrupts my worḱflow to have to manually close the tab every time.

mrintegrity avatar Mar 27 '18 07:03 mrintegrity

It's been a while, but I'd like to know if this is getting fixed in the near future

nurtext avatar Jul 10 '19 07:07 nurtext

Is there any other way to close empty tabs in Atom automatically? As not many people seem to be bothered by this behavior, maybe others are using a workaround?

mediafinger avatar Jul 16 '19 12:07 mediafinger

any update on this ?

NRGLine4Sec avatar Nov 05 '20 09:11 NRGLine4Sec

Problem still there, still annoying. Is there something we're all missing?

agrossfield avatar Jan 21 '21 17:01 agrossfield

I'll add voice to the chorus for fixing this.

adavie1 avatar Feb 16 '21 11:02 adavie1

I just started using the Git/GitHub integration in Atom after using an external GUI for years. Perhaps it's because I disabled pending pane items (as suggested in #1160), but this is also happening for me, and it's really annoying.

I should probably see if I can contribute a fix in PR form, but in the meantime, I came up with the workaround that @mediafinger was asking for. Drop this into your init-script and it should automatically close these tabs when they become empty. (EDIT: Made some tweaks to try to stave off race conditions.)

(FURTHER EDIT: Actually, let's just make this a Gist.)

// (never mind; see gist above)

That ought to fix it for any new Atom windows; run the “Reload Window” command on any existing windows that you want to pick up this behavior.

I've played around with this workaround for ten minutes and tried to break it, but haven't been successful yet. If it doesn't work for you, see if there are any errors in your console (run the “Toggle Dev Tools” command) and let me know.

If you're an init.coffee person rather than init.js, I apologize.

savetheclocktower avatar Feb 22 '22 01:02 savetheclocktower