Skip to content

Refactor terminal modes#30

Draft
kapunga wants to merge 2 commits intocreativescala:mainfrom
kapunga:refactor-terminal-modes
Draft

Refactor terminal modes#30
kapunga wants to merge 2 commits intocreativescala:mainfrom
kapunga:refactor-terminal-modes

Conversation

@kapunga
Copy link
Contributor

@kapunga kapunga commented Apr 18, 2025

Move function bracketing from the lower level terminal implementations to the higher level traits. Lower level terminal implementations now return a rollback thunk: () => Unit to be called generically to perform a rollback. I made the lower level terminal methods package private as you have to be careful to call the rollback in a finally block.

Resolves #27

kapunga added 2 commits May 2, 2025 22:51
Lifts the usage of `raw(f)` one level higher into the RawMode effect
trait and creates a method on the lower level terminals that enters raw
mode and returns a thunk to exit raw mode.
Lift application and alternateScreen modes into higher level API,
leaving low level terminal to have a set and rollback.
@kapunga kapunga force-pushed the refactor-terminal-modes branch from 254c375 to 4221fc7 Compare May 3, 2025 02:51
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.

Refactor terminal modes to make them usable with effect systems

1 participant