Modify user's shell profile to enable/disable shell autocompletion

What does this merge request do and why?

  • Adds a new config option gdk.shell_completion to enable shell completion automatically
  • Rake task gdk:shell_completion is added which reads the current shell profile and according to the config option modifies user's shell profile.
  • gdk:shell_completion task is added to rake task gdk:reconfigure
  • If an unsupported shell (other then bash and zsh) is detected or a profile is not found, manual setup instructions are shown in output.

Closes: #2498 (closed)

How to set up and validate locally

  1. Verify no prior shell completion block in shell profile

    image.png

  2. Enable gdk.shell_completion config option with gdk config set gdk.shell_completion true (Default option is false, with false value gdk:shell_completion rake task will remove shell completion related bash script load command)

  3. Run gdk rake gdk:shell_completion or gdk reconfigure to modify the shell profile, verify the updated shell profile.

  4. Restart or source the shell profile for changes to take effect with enabled shell completion for gdk.

    image.png

  5. To disable shell completion: gdk config set gdk.shell_completion true followed by gdk rake gdk:shell_completion

    image.png

  6. gdk:shell_completion rake task is idempotent, It will detect existence of shell completion block in shell profile and notify the same.

    image.png

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This MR references an issue describing the change.
  • This change is backward compatible. If not, include steps to communicate to users.
  • Tests added for new functionality. If not, raise an issue to follow-up.
  • Observability added/updated (logging, metrics, tracing).
  • Documentation added/updated.
  • Announcement added for notable changes.
  • gdk doctor test added.

Merge request reports

Loading