VisionSystemsInc / VisionSystemsInc/vsi_common

create an atexit trap for next_section

Open
#350 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8
Forks
9
Avg merge
36m
Merged PRs (30d)
1

Description

git_mirror:next_section should have an ERR and/or EXIT trap setup so that when the program exits, the user's prompt doesn't inherit the color. This would avoid us having to call this at the end of each function that uses next_section in git_mirror:

  # Reset the color
  echo -n $'\e[0m'

We could also move it to colors.bsh. Cf. colors.bsh:get_color

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with linux/git_mirror at the next_section function and compare its color handling with colors.bsh:get_color. Determine whether an ERR or EXIT trap belongs in git_mirror or colors.bsh, then verify that the terminal color is reset when the script exits without requiring each caller to emit the reset sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.