Skip to content

feat: make the clear command behave as reset#2458

Merged
RohitKushvaha01 merged 1 commit into
Acode-Foundation:mainfrom
RohitKushvaha01:main
Jul 8, 2026
Merged

feat: make the clear command behave as reset#2458
RohitKushvaha01 merged 1 commit into
Acode-Foundation:mainfrom
RohitKushvaha01:main

Conversation

@RohitKushvaha01

Copy link
Copy Markdown
Member

Closes #2196

@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR maps the clear command to reset inside the Alpine terminal's initrc, replicating Termux's non-standard behaviour (closes #2196). The rest of the diff is trailing-whitespace cleanup with no functional impact.

  • Adds alias clear='reset' to the initrc heredoc so that typing clear performs a full terminal reset rather than a simple screen-clear.
  • Removes trailing whitespace from several lines in init-alpine.sh (no semantic changes).
  • Removes a redundant inline comment (#actual source) near the terminal launch command.

Confidence Score: 5/5

Safe to merge — the alias addition is correct, the whitespace cleanup is inert, and all previously raised concerns have been resolved.

The functional change is a single alias line inside a well-understood heredoc. There are no logic errors, no unsafe variable interactions between the reset variable in command_not_found_handle and the reset command invoked by the alias (they occupy different namespaces), and the previous substantive concerns were explicitly acknowledged and resolved by the team.

No files require special attention.

Important Files Changed

Filename Overview
src/plugins/terminal/scripts/init-alpine.sh Adds alias clear='reset' to the initrc heredoc and removes trailing whitespace; logic is correct and the alias placement is safe.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[init-alpine.sh runs] --> B{initrc exists?}
    B -- No --> C[Write initrc via heredoc\nIncludes: alias clear='reset']
    B -- Yes --> D[Skip heredoc write]
    C --> E{PS1 present in initrc?}
    D --> E
    E -- No --> F[Append PS1 line]
    E -- Yes --> G[Skip PS1]
    F --> H[chmod +x initrc]
    G --> H
    H --> I[Launch: bash --rcfile /initrc -i]
    I --> J[User types 'clear']
    J --> K[Alias expands to 'reset']
    K --> L[Terminal fully reset via RIS sequence]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[init-alpine.sh runs] --> B{initrc exists?}
    B -- No --> C[Write initrc via heredoc\nIncludes: alias clear='reset']
    B -- Yes --> D[Skip heredoc write]
    C --> E{PS1 present in initrc?}
    D --> E
    E -- No --> F[Append PS1 line]
    E -- Yes --> G[Skip PS1]
    F --> H[chmod +x initrc]
    G --> H
    H --> I[Launch: bash --rcfile /initrc -i]
    I --> J[User types 'clear']
    J --> K[Alias expands to 'reset']
    K --> L[Terminal fully reset via RIS sequence]
Loading

Reviews (2): Last reviewed commit: "feat: make the clear command behave as r..." | Re-trigger Greptile

Comment thread src/plugins/terminal/scripts/init-alpine.sh
Comment thread src/plugins/terminal/scripts/init-alpine.sh
@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptileai

@RohitKushvaha01 RohitKushvaha01 merged commit c0b9f00 into Acode-Foundation:main Jul 8, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

'clear' command on terminal doesn't work properly

1 participant