Skip to content

File wsh_shell_esc.h

FileList > src > wsh_shell_esc.h

Go to the source code of this file

Escape sequence handling logic for WSH shell. More...

  • #include "wsh_shell_cfg.h"
  • #include "wsh_shell_history.h"
  • #include "wsh_shell_io.h"

Classes

Type Name
struct WshShellEsc_Action_t
Escape sequence to handler mapping.
struct WshShellEsc_Storage_t
Escape sequence input state tracker.

Public Types

Type Name
typedef void(* WshShellEsc_Hadler_t
Escape sequence handler function type.

Public Functions

Type Name
void WshShellEsc_Handler (WshShellHistory_IO_t * pHistIO, WshShellIO_CommandLine_t * pCommandLine, WshShellEsc_Storage_t * pEscStorage, const WshShell_Char_t symbol)
Handles incoming escape sequence character.
WshShell_Bool_t WshShellEsc_IsSeqStarted (WshShellEsc_Storage_t * pEscStorage)
Checks if escape sequence is in progress.
void WshShellEsc_StartSeq (WshShellEsc_Storage_t * pEscStorage)
Starts a new escape sequence.

Detailed Description

Provides functionality to process ANSI escape sequences (e.g., arrow keys) and interact with shell history and input buffer.

Author:

Whoosh Embedded Team

Copyright:

Copyright (c) 2025

Public Types Documentation

typedef WshShellEsc_Hadler_t

Escape sequence handler function type.

typedef void(* WshShellEsc_Hadler_t) (WshShellHistory_IO_t *pHistIO, WshShellIO_CommandLine_t *pCommandLine);


Public Functions Documentation

function WshShellEsc_Handler

Handles incoming escape sequence character.

1
2
3
4
5
6
void WshShellEsc_Handler (
    WshShellHistory_IO_t * pHistIO,
    WshShellIO_CommandLine_t * pCommandLine,
    WshShellEsc_Storage_t * pEscStorage,
    const WshShell_Char_t symbol
) 

Matches current buffer against known ANSI sequences and triggers appropriate handler.

Parameters:

  • pHistIO Pointer to shell history interface
  • pCommandLine Pointer to input interaction buffer
  • pEscStorage Pointer to escape sequence buffer
  • symbol Incoming character to append

function WshShellEsc_IsSeqStarted

Checks if escape sequence is in progress.

1
2
3
WshShell_Bool_t WshShellEsc_IsSeqStarted (
    WshShellEsc_Storage_t * pEscStorage
) 

Parameters:

  • pEscStorage Pointer to escape sequence buffer

Returns:

WshShell_Bool_t true if sequence has started


function WshShellEsc_StartSeq

Starts a new escape sequence.

1
2
3
void WshShellEsc_StartSeq (
    WshShellEsc_Storage_t * pEscStorage
) 

Initializes the escape buffer with ESC char.

Parameters:

  • pEscStorage Pointer to escape sequence buffer


The documentation for this class was generated from the following file src/wsh_shell_esc.h