composer-version-manager / cvm

Painstakingly simple version switching for Composer. Built for teams with many PHP projects.
Other
7 stars 1 forks source link

Current version should be tracked on a per-tty basis #9

Open morgan-wowk opened 3 years ago

morgan-wowk commented 3 years ago

Problem

If you are working in multiple TTYs then the current version from the ~/.cvm/config.json will conflict. When the current version changes in one TTY, and you perform an action in a different TTY, the current version will not match and this will cause unnecessary stdout logging and PATH updates.

Steps to reproduce

  1. Open TTY 1
  2. Set a global composer version
  3. Navigate somewhere within the global scope (no cvm_config)
  4. Notice the TTY will output "Using composer version ..."
  5. The next time to run ls or any command, it should not output Using composer version ... every time. It should only do this when the current version changes.
  6. Open TTY 2
  7. Navigate to a non-global scope. Somewhere that has a cvm_config with another version.
  8. Notice it will output "Using composer version ..." as expected
  9. Go back to TTY 1 and run any command
  10. Notice it will output "Using composer version ..." even though nothing has changed in the current TTY. This is because both TTYs are looking at and updating the same current field in the ~/.cvm/config.json

Solution

Come up with a way of tracking the current version on a per-tty basis. Not for the application as a whole.

morgan-wowk commented 3 years ago

Adding bug label as this also prevents the global version from being used when the current version of a separate TTY matches the global version.