Skip to content

(pshapp, auth): use TCSADRAIN instead of TCSAFLUSH for termios setting#265

Open
julianuziemblo wants to merge 1 commit into
masterfrom
julianuziemblo/RTOS-1355
Open

(pshapp, auth): use TCSADRAIN instead of TCSAFLUSH for termios setting#265
julianuziemblo wants to merge 1 commit into
masterfrom
julianuziemblo/RTOS-1355

Conversation

@julianuziemblo

@julianuziemblo julianuziemblo commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

YT: RTOS-1355

Description

Until now, before every command, input was going to be flushed (which was not implemented in libtty). When it is implemented though, input from before the parsing of a command is started should not be flushed as we don't want to lose any characters from before the prompt is displayed to the user.

From what I've seen, e.g. GNU bash also does TCSADRAIN instead of TCSAFLUSH when setting termios attributes.

Motivation and Context

Connected to phoenix-rtos/phoenix-rtos-devices#671, which implements flushing/draining the input/output buffers on TCSETS/TCSETSW/TCSETSF underlying ioctl commands. It became apparent then that we're losing characters that were inputed before the prompt appeared.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on:

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the terminal attribute configuration in psh/pshapp/pshapp.c to use TCSADRAIN instead of TCSAFLUSH when enabling raw mode. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@julianuziemblo julianuziemblo marked this pull request as draft June 17, 2026 16:11
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

Unit Test Results

10 860 tests  ±0   10 190 ✅ ±0   52m 40s ⏱️ -17s
   670 suites ±0      670 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit fc38ad3. ± Comparison against base commit 3c030de.

♻️ This comment has been updated with latest results.

@julianuziemblo julianuziemblo changed the title pshapp: use TCSADRAIN instead of TCSAFLUSH before parsing cmd (pshapp, auth): use TCSADRAIN instead of TCSAFLUSH for termios setting Jun 18, 2026
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1355 branch from 7f8ebc5 to df9775c Compare June 18, 2026 09:24
Until now, before every command, input was going to be flushed (which was not
implemented in libtty). When it is implemented, input before parsing a command
should not be flushed as we don't want to lose any characters from before the
prompt is displayed to the user.

YT: RTOS-1355
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1355 branch from df9775c to fc38ad3 Compare June 18, 2026 09:27
@julianuziemblo julianuziemblo marked this pull request as ready for review June 18, 2026 09:45
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.

1 participant