Menu

#606 Improve terminal functionality

v1.1.x
closed
gui (58)
v1.1.4
New Functionality
2022-01-17
2021-07-27
Erik Hänel
No

The terminal shall provide two more functionalities / changes:

  • If the kernel is not busy hitting the ESC key shall clear the current line
  • The arrow keys shall not override the current line if the user already typed something

Analysis:

The ESC-part can be implemented by adding a hook into void NumeReTerminal::OnKeyDown() in gui/terminal/terminal.cpp at line 1209 near the if (m_isBusy) check and calling void GenericTerminal::erase_usercontent_line()

The arrow keys are handled in bool GenericTerminal::cursor_up() and bool GenericTerminal::cursor_down() in file gui/terminal/actions.cpp. Here one can examine the previous or the next entry in the history and check, whether it might be a candidate for autocompletion (use string TextManager::getCurrentInputLine() for obtaining the contents of the current line). If no autocompletion is possible, just return false.

Implementation:

  • Implementation: Implemented the terminal feature as described above.
  • Revision: [r991]
  • Implementation test: (Describe the type of test, which you performed, and if it was successful)

Documentation:

  • ChangesLog updated
  • Code changes commented
  • Documentation articles:
    • corresponding documentation articles updated
    • new documentation articles created
    • not needed
  • Language files:
    • corresponding language files updated
    • not needed

Tests:

Functionality was tested manually. No deviations detected.

Related

Commit: [r991]

Discussion

  • Erik Hänel

    Erik Hänel - 2021-08-16
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2021-08-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,3 +2,25 @@
    
     * If the kernel is not busy hitting the ESC key shall clear the current line
     * The arrow keys shall not override the current line if the user already typed something
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2021-08-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,7 +4,9 @@
     * The arrow keys shall not override the current line if the user already typed something
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +The ESC-part can be implemented by adding a hook into `void NumeReTerminal::OnKeyDown()` in `gui/terminal/terminal.cpp` at line 1209 near the `if (m_isBusy)` check and calling `void GenericTerminal::erase_usercontent_line()`
    +
    +The arrow keys are handled in `bool GenericTerminal::cursor_up()` and `bool GenericTerminal::cursor_down()` in file `gui/terminal/actions.cpp`. Here one can examine the previous or the next entry in the history and check, whether it might be a candidate for autocompletion (use `string TextManager::getCurrentInputLine()` for obtaining the contents of the current line). If no autocompletion is possible, just return `false`.
    
     ###Implementation:
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2021-08-18
    • labels: --> gui
     
  • Raphael Zehner

    Raphael Zehner - 2021-08-21
    • assigned_to: Erik Hänel --> Raphael Zehner
     
  • Raphael Zehner

    Raphael Zehner - 2021-08-25
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,20 +9,20 @@
     The arrow keys are handled in `bool GenericTerminal::cursor_up()` and `bool GenericTerminal::cursor_down()` in file `gui/terminal/actions.cpp`. Here one can examine the previous or the next entry in the history and check, whether it might be a candidate for autocompletion (use `string TextManager::getCurrentInputLine()` for obtaining the contents of the current line). If no autocompletion is possible, just return `false`.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    +* Implementation: Implemented the terminal feature as described above.
    +* Revision: [r991]
     * Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
     * **Documentation articles:**
         * [ ] corresponding documentation articles updated
         * [ ] new documentation articles created
    -    * [ ] not needed
    +    * [x] not needed
     * **Language files:**
         * [ ] corresponding language files updated
    -    * [ ] not needed
    +    * [x] not needed
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
    • assigned_to: Raphael Zehner --> Erik Hänel
     

    Related

    Commit: [r991]

  • Erik Hänel

    Erik Hänel - 2022-01-17
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -25,4 +25,4 @@
         * [x] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Functionality was tested manually. No deviations detected.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel