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

bconsole: remove repeated successive entries from history. #1162

Conversation

alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Apr 14, 2022

Description

In bconsole, when you type a command multiple times in a row, all these entries are saved in the history and make previous command navigation annoying.
Example: you do run job=xxx <a lot of arguments> yes and want to monitor the stats of the job, so you start typing status storage every now and then to see how the job is behaving. Now you want to rerun the same job with the same run job=xxx <a lot of arguments> yes command, but it is buried behind multiple status storage commands, and you would have to either press the arrow button up as many times as you entered the status storage command, or have to do a search. This PR changes the behavior by making sure multiple same commands in a row are only saved once.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
  • If backport: add original PR number and target branch at top of this file: Backport of PR#000 to bareos-2x
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing

@alaaeddineelamri alaaeddineelamri self-assigned this Apr 14, 2022
@alaaeddineelamri alaaeddineelamri changed the title bconsole: history repeated entries bconsole: remove repeated successive entries from history. Apr 14, 2022
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bconsole-history-repeated-lines branch 3 times, most recently from 540adec to 16de363 Compare April 20, 2022 08:23
@pstorz pstorz self-requested a review April 21, 2022 09:20
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bconsole-history-repeated-lines branch 2 times, most recently from b5786a8 to 7637188 Compare April 28, 2022 08:07
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bconsole-history-repeated-lines branch from 7637188 to 180d4c8 Compare May 23, 2022 08:39
@pstorz pstorz force-pushed the dev/alaaeddineelamri/master/bconsole-history-repeated-lines branch from 180d4c8 to fee9100 Compare June 13, 2022 10:29
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work. However I am not sure that the history_base variable is 0 or when it is not.

core/src/console/console.cc Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bconsole-history-repeated-lines branch from fee9100 to fda08ba Compare June 13, 2022 13:16
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@pstorz pstorz merged commit 734ec60 into bareos:master Jun 14, 2022
@pstorz pstorz deleted the dev/alaaeddineelamri/master/bconsole-history-repeated-lines branch June 14, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants