Merge branch 'development' of https://github.com/TimonPost/crossterm into development

This commit is contained in:
TimonPost 2018-06-25 20:39:05 +02:00
commit a200b68416
11 changed files with 359 additions and 380 deletions

View File

@ -3,21 +3,15 @@
<component name="ChangeListManager">
<list default="true" id="310aeab2-4737-4e8e-b7eb-0aac10d104a3" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/bin.rs" beforeDir="false" afterPath="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/bin.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/cursor/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/cursor/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/cursor/ansi_cursor.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/cursor/ansi_cursor.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/cursor/cursor.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/cursor/cursor.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/cursor/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/cursor/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/cursor/winapi_cursor.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/cursor/winapi_cursor.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/manager/ansi_manager.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/manager/ansi_manager.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/kernel/unix_kernel/terminal.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/kernel/unix_kernel/terminal.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/manager/manager.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/manager/manager.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/shared/functions.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/shared/functions.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/shared/screen.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/shared/screen.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/state/commands/shared_commands.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/state/commands/shared_commands.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/state/commands/unix_command.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/state/commands/unix_command.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/state/commands/win_commands.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/state/commands/win_commands.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/terminal/ansi_terminal.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/terminal/ansi_terminal.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/terminal/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/terminal/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/terminal/terminal.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/terminal/terminal.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/terminal/winapi_terminal.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/terminal/winapi_terminal.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/style/styles/styledobject.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/style/styles/styledobject.rs" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@ -28,74 +22,23 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="winapi_cursor.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/cursor/winapi_cursor.rs">
<file leaf-file-name="manager.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/manager/manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="740">
<caret line="64" selection-start-line="64" selection-end-line="64" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="winapi_terminal.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/terminal/winapi_terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="689">
<caret line="143" column="5" selection-start-line="143" selection-start-column="5" selection-end-line="143" selection-end-column="5" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ansi_terminal.rs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/terminal/ansi_terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="587">
<caret line="65" column="25" lean-forward="true" selection-start-line="65" selection-start-column="25" selection-end-line="65" selection-end-column="25" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="macros.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/shared/macros.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="traits.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/shared/traits.rs">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret selection-end-line="4" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="bin.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/bin.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="714">
<caret line="42" column="12" selection-start-line="42" selection-start-column="12" selection-end-line="42" selection-end-column="12" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="terminal.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/terminal/terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="281">
<caret line="189" selection-start-line="189" selection-end-line="189" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="mod.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/terminal/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="757">
<caret line="51" column="39" selection-start-line="51" selection-start-column="39" selection-end-line="51" selection-end-column="39" />
<state relative-caret-position="285">
<caret line="19" column="1" selection-start-line="19" selection-start-column="1" selection-end-line="19" selection-end-column="1" />
<folding>
<element signature="e#1294#1295#0" expanded="true" />
<element signature="e#1377#1378#0" expanded="true" />
<element signature="e#1471#1472#0" expanded="true" />
<element signature="e#1525#1526#0" expanded="true" />
<element signature="e#1618#1619#0" expanded="true" />
<element signature="e#1676#1677#0" expanded="true" />
<element signature="e#1844#1845#0" expanded="true" />
<element signature="e#1889#1890#0" expanded="true" />
<element signature="e#1934#1935#0" expanded="true" />
<element signature="e#1976#1977#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -103,17 +46,80 @@
<file leaf-file-name="screen.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/shared/screen.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="36" selection-start-line="36" selection-end-line="36" />
<state relative-caret-position="770">
<caret line="101" column="35" selection-start-line="101" selection-start-column="35" selection-end-line="101" selection-end-column="35" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ansi_cursor.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/cursor/ansi_cursor.rs">
<file leaf-file-name="raw.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/shared/raw.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="731">
<caret line="92" selection-start-line="92" selection-end-line="92" />
<state relative-caret-position="350">
<caret line="53" column="61" selection-start-line="53" selection-start-column="61" selection-end-line="53" selection-end-column="61" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="shared_commands.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/state/commands/shared_commands.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="440">
<caret line="40" column="1" selection-start-line="40" selection-start-column="1" selection-end-line="40" selection-end-column="1" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="unix_command.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/state/commands/unix_command.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="600">
<caret line="40" column="9" selection-start-line="40" selection-start-column="9" selection-end-line="40" selection-end-column="9" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="styledobject.rs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/style/styles/styledobject.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="545">
<caret line="142" column="15" selection-start-line="142" selection-start-column="15" selection-end-line="142" selection-end-column="15" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="state_manager.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/state/state_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="735">
<caret line="52" column="28" selection-start-line="52" selection-start-column="11" selection-end-line="52" selection-end-column="28" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="win_commands.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/state/commands/win_commands.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="455">
<caret line="230" column="22" selection-start-line="230" selection-start-column="22" selection-end-line="230" selection-end-column="22" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ansi_manager.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/manager/ansi_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="28" selection-start-line="9" selection-start-column="11" selection-end-line="9" selection-end-column="28" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="mod.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/manager/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="29" selection-start-line="9" selection-start-column="29" selection-end-line="9" selection-end-column="29" />
</state>
</provider>
</entry>
@ -129,7 +135,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>conte</find>
<find>terminal_cursor</find>
<find>term</find>
<find>ScreenManager</find>
@ -150,7 +155,6 @@
<find>get_to_alternate_screen_command</find>
<find>&amp;context</find>
<find>cursor</find>
<find>context</find>
<find>Mutex</find>
<find>WriteConsoleOutputW</find>
<find>CONSOLE_CURSOR_INFO</find>
@ -159,6 +163,8 @@
<find>fmt</find>
<find>STD_OUTPUT_HANDLE</find>
<find>data</find>
<find>context</find>
<find>WinApiScreenManager</find>
</findStrings>
<replaceStrings>
<replace>crossterm_cursor</replace>
@ -187,7 +193,6 @@
<option value="$PROJECT_DIR$/src/shared/terminal.rs" />
<option value="$PROJECT_DIR$/src/terminal/raw.rs" />
<option value="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/terminal/mod.rs" />
<option value="$PROJECT_DIR$/src/kernel/unix_kernel/terminal.rs" />
<option value="$PROJECT_DIR$/src/state/mod.rs" />
<option value="$PROJECT_DIR$/src/shared/mod.rs" />
<option value="$PROJECT_DIR$/src/style/styles/mod.rs" />
@ -198,11 +203,8 @@
<option value="$PROJECT_DIR$/src/style/color/ansi_color.rs" />
<option value="$PROJECT_DIR$/src/style/mod.rs" />
<option value="$PROJECT_DIR$/src/style/color/winapi_color.rs" />
<option value="$PROJECT_DIR$/src/state/commands/unix_command.rs" />
<option value="$PROJECT_DIR$/src/state/commands/shared_commands.rs" />
<option value="$PROJECT_DIR$/src/lib.rs" />
<option value="$PROJECT_DIR$/src/style/color/color.rs" />
<option value="$PROJECT_DIR$/src/shared/functions.rs" />
<option value="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/color/mod.rs" />
<option value="$PROJECT_DIR$/src/shared/raw.rs" />
<option value="$PROJECT_DIR$/src/state/command_manager.rs" />
@ -216,23 +218,27 @@
<option value="$PROJECT_DIR$/src/state/commands/mod.rs" />
<option value="$PROJECT_DIR$/src/state/context.rs" />
<option value="$PROJECT_DIR$/src/style/styles/objectstyle.rs" />
<option value="$PROJECT_DIR$/src/style/styles/styledobject.rs" />
<option value="$PROJECT_DIR$/src/state/state_manager.rs" />
<option value="$PROJECT_DIR$/src/state/commands/win_commands.rs" />
<option value="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/cursor/mod.rs" />
<option value="$PROJECT_DIR$/src/manager/ansi_manager.rs" />
<option value="$PROJECT_DIR$/src/cursor/ansi_cursor.rs" />
<option value="$PROJECT_DIR$/src/cursor/mod.rs" />
<option value="$PROJECT_DIR$/src/manager/manager.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs" />
<option value="$PROJECT_DIR$/src/cursor/winapi_cursor.rs" />
<option value="$PROJECT_DIR$/src/cursor/cursor.rs" />
<option value="$PROJECT_DIR$/src/shared/screen.rs" />
<option value="$PROJECT_DIR$/src/terminal/mod.rs" />
<option value="$PROJECT_DIR$/src/terminal/winapi_terminal.rs" />
<option value="$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/bin.rs" />
<option value="$PROJECT_DIR$/src/terminal/terminal.rs" />
<option value="$PROJECT_DIR$/src/terminal/ansi_terminal.rs" />
<option value="$PROJECT_DIR$/src/kernel/unix_kernel/terminal.rs" />
<option value="$PROJECT_DIR$/src/shared/functions.rs" />
<option value="$PROJECT_DIR$/src/cursor/cursor.rs" />
<option value="$PROJECT_DIR$/src/manager/manager.rs" />
<option value="$PROJECT_DIR$/src/shared/screen.rs" />
<option value="$PROJECT_DIR$/src/state/commands/win_commands.rs" />
<option value="$PROJECT_DIR$/src/state/commands/shared_commands.rs" />
<option value="$PROJECT_DIR$/src/state/commands/unix_command.rs" />
<option value="$PROJECT_DIR$/src/style/styles/styledobject.rs" />
</list>
</option>
</component>
@ -272,7 +278,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="AndroidView" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
@ -285,33 +291,6 @@
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="examples" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="examples" type="462c0819:PsiDirectoryNode" />
<item name="Crossterm 0.2.2 - New Version (Not finished)" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="examples" type="462c0819:PsiDirectoryNode" />
<item name="Crossterm 0.2.2 - New Version (Not finished)" type="462c0819:PsiDirectoryNode" />
<item name="color" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="examples" type="462c0819:PsiDirectoryNode" />
<item name="Crossterm 0.2.2 - New Version (Not finished)" type="462c0819:PsiDirectoryNode" />
<item name="cursor" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="examples" type="462c0819:PsiDirectoryNode" />
<item name="Crossterm 0.2.2 - New Version (Not finished)" type="462c0819:PsiDirectoryNode" />
<item name="terminal" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
@ -334,7 +313,7 @@
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="kernel" type="462c0819:PsiDirectoryNode" />
<item name="windows_kernel" type="462c0819:PsiDirectoryNode" />
<item name="unix_kernel" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
@ -392,7 +371,7 @@
</subPane>
</pane>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="AndroidView" />
</panes>
</component>
<component name="PropertiesComponent">
@ -471,19 +450,6 @@
<properties />
<listeners />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
</configuration>
</component>
<component name="SvnConfiguration">
<configuration />
@ -595,10 +561,10 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="609271000" />
<option name="totallyTimeSpent" value="611285000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="2576" height="1056" extended-state="6" />
<frame x="0" y="0" width="2560" height="1050" extended-state="6" />
<editor active="true" />
<layout>
<window_info anchor="right" id="Palette" order="3" />
@ -607,15 +573,15 @@
<window_info anchor="right" id="Palette&#9;" order="5" />
<window_info id="Image Layers" order="6" />
<window_info anchor="right" id="Capture Analysis" order="7" />
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.503125" side_tool="true" weight="0.27038628" />
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.503125" side_tool="true" weight="0.27041358" />
<window_info anchor="right" id="Maven Projects" order="4" />
<window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Run" order="2" weight="0.33722162" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.32943678" />
<window_info anchor="bottom" id="Terminal" order="8" />
<window_info id="Capture Tool" order="2" />
<window_info id="Designer" order="3" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.1625" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.11328125" />
<window_info anchor="right" id="Database" order="6" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
@ -623,25 +589,47 @@
<window_info anchor="right" id="Theme Preview" order="8" />
<window_info id="Favorites" order="5" side_tool="true" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info id="Designer" order="3" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Capture Analysis" order="7" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" id="Cargo" order="9" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.1625" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Run" order="2" weight="0.33722162" />
<window_info id="Image Layers" order="6" />
<window_info id="Capture Tool" order="2" />
<window_info id="UI Designer" order="4" />
<window_info anchor="bottom" id="Find" order="1" sideWeight="0.496875" visible="true" weight="0.20828906" />
<window_info anchor="right" id="Theme Preview" order="8" />
<window_info anchor="right" id="Database" order="6" />
<window_info anchor="right" id="Palette&#9;" order="5" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.32943678" />
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.503125" side_tool="true" weight="0.27038628" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="right" id="Maven Projects" order="4" />
<window_info id="Favorites" order="5" side_tool="true" />
</layout>
<layout-to-restore>
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Capture Analysis" order="8" />
<window_info anchor="bottom" id="Version Control" order="8" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="right" id="Cargo" order="4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.1140625" />
<window_info id="Structure" order="1" weight="0.25" />
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info id="Image Layers" order="5" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
@ -652,7 +640,7 @@
<window_info anchor="bottom" id="Terminal" order="9" />
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.5015625" side_tool="true" visible="true" weight="0.24708377" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Version Control" order="8" />
<window_info id="Capture Tool" order="2" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="right" id="Database" order="6" />
@ -674,45 +662,10 @@
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.5/src/shared/minwindef.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="257">
<caret line="23" column="9" selection-start-line="23" selection-start-column="9" selection-end-line="23" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.5/src/um/wincon.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="283">
<caret line="293" column="30" selection-start-line="293" selection-start-column="30" selection-end-line="293" selection-end-column="30" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libcore/result.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207">
<caret line="255" column="9" selection-start-line="255" selection-start-column="9" selection-end-line="255" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/unix_kernel/terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207">
<caret line="122" column="7" selection-start-line="122" selection-start-column="7" selection-end-line="122" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libstd/ffi/c_str.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="325">
<caret line="320" column="7" selection-start-line="320" selection-start-column="7" selection-end-line="320" selection-end-column="7" />
<folding>
<element signature="e#33395#33396#0" expanded="true" />
<element signature="e#33429#33430#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.5/src/shared/minwindef.rs" />
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.5/src/um/wincon.rs" />
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libcore/result.rs" />
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libstd/ffi/c_str.rs" />
<entry file="file://$PROJECT_DIR$/src/style/color/ansi_color.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="564">
@ -727,20 +680,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/commands/shared_commands.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="350">
<caret line="34" column="33" selection-start-line="34" selection-start-column="33" selection-end-line="34" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/style/color/color.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="551">
<caret line="131" column="1" selection-start-line="131" selection-start-column="1" selection-end-line="131" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/terminal/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
@ -748,24 +687,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/raw.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="53" column="61" selection-start-line="53" selection-start-column="61" selection-end-line="53" selection-end-column="61" />
<folding>
<element signature="e#2623#2624#0" expanded="true" />
<element signature="e#2705#2706#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/command_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="142">
<caret line="11" column="32" selection-start-line="11" selection-start-column="32" selection-end-line="11" selection-end-column="32" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/examples/Crossterm 0.2.2 - New Version (Not finished)/terminal/alternate_screen.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1071">
@ -780,38 +701,8 @@
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/liballoc/boxed.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1564">
<caret line="92" column="11" selection-start-line="92" selection-start-column="11" selection-end-line="92" selection-end-column="11" />
<folding>
<element signature="e#2671#2672#0" expanded="true" />
<element signature="e#2691#2692#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="527">
<caret line="31" column="19" selection-start-line="31" selection-start-column="19" selection-end-line="31" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.5/src/um/winnt.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="738">
<caret line="118" column="9" selection-start-line="118" selection-start-column="9" selection-end-line="118" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/functions.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="424">
<caret line="29" column="17" selection-start-line="29" selection-start-column="17" selection-end-line="29" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/liballoc/boxed.rs" />
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.5/src/um/winnt.rs" />
<entry file="file://$PROJECT_DIR$/src/state/commands/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="493">
@ -826,13 +717,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/style/styles/styledobject.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
@ -840,24 +724,10 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/state_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="731">
<caret line="46" column="22" selection-start-line="46" selection-start-column="22" selection-end-line="46" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/commands/unix_command.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" column="18" selection-start-line="3" selection-start-column="18" selection-end-line="3" selection-end-column="18" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Cargo.toml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="16" column="84" selection-start-line="16" selection-start-column="84" selection-end-line="16" selection-end-column="84" />
<state relative-caret-position="435">
<caret line="29" selection-start-line="29" selection-end-line="29" />
</state>
</provider>
</entry>
@ -882,24 +752,7 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/ansi_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="16" column="1" selection-start-line="16" selection-start-column="1" selection-end-line="16" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libcore/time.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="305">
<caret line="109" column="17" selection-start-line="109" selection-start-column="17" selection-end-line="109" selection-end-column="17" />
<folding>
<element signature="e#3609#3610#0" expanded="true" />
<element signature="e#3657#3658#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libcore/time.rs" />
<entry file="file://$PROJECT_DIR$/src/cursor/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="774">
@ -928,20 +781,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="30" column="65" selection-start-line="30" selection-start-column="65" selection-end-line="30" selection-end-column="65" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/commands/win_commands.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321">
<caret line="192" column="29" selection-start-line="192" selection-start-column="29" selection-end-line="192" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="399">
@ -953,26 +792,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
<folding>
<element signature="e#853#854#0" expanded="true" />
<element signature="e#923#924#0" expanded="true" />
<element signature="e#1001#1002#0" expanded="true" />
<element signature="e#1069#1070#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/win_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="451">
<caret line="36" column="38" selection-start-line="36" selection-start-column="38" selection-end-line="36" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/cursor/cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-510">
<caret line="21" column="56" selection-start-line="21" selection-start-column="56" selection-end-line="21" selection-end-column="56" />
</state>
</provider>
</entry>
@ -990,13 +809,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/screen.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="36" selection-start-line="36" selection-end-line="36" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/terminal/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="757">
@ -1046,6 +858,130 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/command_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="24" selection-start-line="24" selection-end-line="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/unix_kernel/terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="508">
<caret line="67" column="38" selection-start-line="67" selection-start-column="38" selection-end-line="67" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/functions.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="525">
<caret line="38" selection-start-line="38" selection-end-line="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/win_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="488">
<caret line="36" column="38" selection-start-line="36" selection-start-column="38" selection-end-line="36" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/style/color/color.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="24" column="64" selection-start-line="24" selection-start-column="20" selection-end-line="24" selection-end-column="64" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/cursor/cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="405">
<caret line="27" selection-start-line="27" selection-end-line="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/ansi_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="28" selection-start-line="9" selection-start-column="11" selection-end-line="9" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="29" selection-start-line="9" selection-start-column="29" selection-end-line="9" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/manager/manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="19" column="1" selection-start-line="19" selection-start-column="1" selection-end-line="19" selection-end-column="1" />
<folding>
<element signature="e#1294#1295#0" expanded="true" />
<element signature="e#1377#1378#0" expanded="true" />
<element signature="e#1471#1472#0" expanded="true" />
<element signature="e#1525#1526#0" expanded="true" />
<element signature="e#1618#1619#0" expanded="true" />
<element signature="e#1676#1677#0" expanded="true" />
<element signature="e#1844#1845#0" expanded="true" />
<element signature="e#1889#1890#0" expanded="true" />
<element signature="e#1934#1935#0" expanded="true" />
<element signature="e#1976#1977#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/raw.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="350">
<caret line="53" column="61" selection-start-line="53" selection-start-column="61" selection-end-line="53" selection-end-column="61" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/screen.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="770">
<caret line="101" column="35" selection-start-line="101" selection-start-column="35" selection-end-line="101" selection-end-column="35" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/state_manager.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="735">
<caret line="52" column="28" selection-start-line="52" selection-start-column="11" selection-end-line="52" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/commands/shared_commands.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="440">
<caret line="40" column="1" selection-start-line="40" selection-start-column="1" selection-end-line="40" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/commands/win_commands.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="455">
<caret line="230" column="22" selection-start-line="230" selection-start-column="22" selection-end-line="230" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/state/commands/unix_command.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="600">
<caret line="40" column="9" selection-start-line="40" selection-start-column="9" selection-end-line="40" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/style/styles/styledobject.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="545">
<caret line="142" column="15" selection-start-line="142" selection-start-column="15" selection-end-line="142" selection-end-column="15" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View File

@ -2,21 +2,47 @@
Things where I am working on now:
I have inplemented the alternate and raw screen features for unix systems. Now I am trying to get this also to work for windows with WINAPI.
I have implemented the alternate and raw screen features for Unix systems. Now I am trying to get this also to work for windows with WINAPI.
The next version will have api braking changes. Why I needed to do that is essential for the functioning of these above features.
In the new version you must provide the Context type to the function calls `cursor(), color(), terminal()`. This type is used by Crossterm for managing the state of the terminal and for futures like `AlternateScreen` and `Rawscreen`.
- At first:
I needed to create some `Context` types withs can manage the terminal state. So that when changes are made to the terminal the can be reverted. This is handy when using raw terminal mode and enabling some mode on the terminal like ansi escape codes for windows. When the `Context` dispposes all changes made will be reverted so that the user terminal is back in its starting state.
Like described above the next version will have api braking changes. Why I needed to do that is essential for the functioning of the above features.
When in unix sytems you want to execute some ANSI escape code you have to write it to terminal stdout (screen ouput).
- At first `Terminal state`:
//like
write!(std::io::stdout(), "{}", "some ANSI code".
Because this is a terminal manipulating library there will be made changes to terminal when running an process. If you stop the process you want the terminal back in its original state. Therefore, I need to track the changes made to the terminal. This is done in the `Context` struct so that they can be undone when the process ends.
But when using `std::io::stdout` you will have an handle to the current screen. And not the alternate screen. And when using alternate screen you don't want to write to the mainscreen stdout. But to the alternate screen stdout. For this we also have the `Context` type withs has contains an type to manage the screen.
So that is why I have created the `Context` type. To mange the terminal state changes and to run cleanup code. And for managegin the screen output.
- At second `Handle to the console`
In rust we can call `stdout()` to get an handle to the current default console handle. For example when in unix sytems you want to execute some ANSI escape code you have to write it to terminal. I can write it to stdout (screen ouput) withs is the main screen.
//like
write!(std::io::stdout(), "{}", "some ANSI code").
But things change when we are in alternate screen. If I execute the code above the ANSI escape code to the current stdout it will be written to the main handle and not or alternate handle, and this is not what we want.
To solve the problem, we need to have one place to store the handle to the console screen. So that we can write to this handle during the lifetime of the program in the different modules like `cursor, terminal and color`. This handle is stored in a subtype of the Context type.
Now the user must create an `Context` type for this library.
//like
let context = Context::new();
let cursor = cursor(&context);
let terminal = terminal(&context);
let color = color(&context);
Now we have one global `Context` type which can be used to register terminal state changes, and in with we can manage the terminal stdout (screen output). When this `Context` disposes we run code to clean up the changes that are made to the terminal.
Maybe I am going to make a wrapper for the function calls `cursor, terminal, colour` so that when can avoid passing the context all over the place which makes to code more unreadable to my opinion. I really did not want to make API braking changes, but for the sake of the features I needed to do it.
// maybe I am going to create some Envoirment type which can be used for getting acces to diffrent modules that this libary provides.
let envoirment = Envoirment::new();
envoirment.color();
envoirment.cursor();
envoirment.terminal();
## Features crossterm 0.1
@ -41,7 +67,7 @@ So that is why I have created the `Context` type. To mange the terminal state ch
- Storing the current cursor position and resetting to that stored cursor position later.
- Resizing the terminal.
### fixes in crossterm 0.2.1
## fixes in crossterm 0.2.1
- Default ANSI escape codes for windows machines, if windows does not support ANSI switsh back to WINAPI.
- method grammer mistake fixed [Issue 3](https://github.com/TimonPost/crossterm/issues/3)
@ -50,11 +76,18 @@ So that is why I have created the `Context` type. To mange the terminal state ch
- The terminal state will be set to its original state when process ends [issue7](https://github.com/TimonPost/crossterm/issues/7).
- Get position unix fixed [issue 8](https://github.com/TimonPost/crossterm/issues/8)
## fixes in crossterm 0.2.2
- Bug see [issue 15](https://github.com/TimonPost/crossterm/issues/15)
## TODO Features crossterm 0.3
- Raw state implementation [Issue 5](https://github.com/TimonPost/crossterm/issues/5).
- Alternate screen implementation.
- Tests
## Features crossterm 0.2.3
- Alternate screen for windows and unix systems.
- Rawscreen for unix systems maybe windows [Issue 5](https://github.com/TimonPost/crossterm/issues/5)..
- Hiding an showing the cursor.
- Control over blinking of the terminal cursor.
## TODO Features crossterm 0.2.2
- Raw state implementation for windows [Issue 5](https://github.com/TimonPost/crossterm/issues/5).
- Alternate screen for windows
## Tested terminals
@ -72,7 +105,7 @@ If you have used this library for an terminal other than the above list without
## How it works
Crossterm is using `WINAPI` for windows systems and `ANSI escape codes` for unix systems. Crossterm provides one base trait with can be implemented for a platform specific instance. For example, there is an implementation for windows (`WINAPI`) and unix(`ANSI`) for the `cursor module`. To call the platform specific implementation there is one module that rules them all. Thrue this module the client calls some action and the module will deside what to do based on the current platform. And it will execute that action.
Crossterm is using `WINAPI` for windows versions lower than windows 10 and `ANSI escape codes` for unix systems. Crossterm provides one base trait with can be implemented for a platform specific instance. For example, there is an implementation for windows (`WINAPI`) and unix(`ANSI`) for the `cursor module`. To call the platform specific implementation there is one module that rules them all. Thrue this module the client can call some action and the module will deside what to do based on the current platform. And it will execute that action.
## Notice
This library is library is stable. There will not be changed mutch in the code design so do not worry to mutch. If there are any changes that affect previous versions I will describe what to change when upgrading crossterm to an newer version.

View File

@ -26,7 +26,7 @@ impl TerminalCursor
#[cfg(not(target_os = "windows"))]
let cursor = Some(AnsiCursor::new(context.clone()) as Box<ITerminalCursor>);
TerminalCursor { terminal_cursor: Some(WinApiCursor::new()), context}
TerminalCursor { terminal_cursor: cursor, context}
}
/// Goto some position (x,y) in the terminal.

View File

@ -41,13 +41,13 @@ pub fn terminal_size() -> (u16,u16) {
}
/// Get the current cursor position.
pub fn pos(terminal: &Context) -> (u16, u16)
pub fn pos(context: Rc<Context>) -> (u16, u16)
{
use std::io::{ Write,Read };
let mut command_id = NoncanonicalModeCommand::new(&terminal.state_manager);
let mut command_id = NoncanonicalModeCommand::new(&context.state_manager);
CommandManager::execute(terminal, command_id);
CommandManager::execute(context.clone(), command_id);
// This code is original written by term_cursor credits to them.
use std::io;
@ -97,7 +97,7 @@ pub fn pos(terminal: &Context) -> (u16, u16)
// Expect `R`
let res = if c == 'R' { (cols as u16, rows as u16) } else { return (0, 0) };
CommandManager::undo(terminal, command_id);
CommandManager::undo(context.clone(), command_id);
res
}

View File

@ -1,6 +1,6 @@
//! This module provides an interface for working with the sceen. With that I mean that you can get or wirte to the handle of the current screen. stdout.
//! Because crossterm can work with alternate screen, we need a place that holds the handle to the current screen. And this module provides this place.
use super::{AnsiScreenManager, WinApiScreenManager, IScreenManager };
use super::*;
use super::super::shared::functions;
use std::any::Any;
@ -24,11 +24,11 @@ impl ScreenManager
let screen_manager = functions::get_module::<Box<IScreenManager>>(Box::from(WinApiScreenManager::new()), Box::from(AnsiScreenManager::new())).unwrap();
#[cfg(not(target_os = "windows"))]
let screen_manager = Box::new(AnsiScreenManager::new());
let screen_manager = Box::from(AnsiScreenManager::new()) as Box<IScreenManager>;
ScreenManager
{
screen_manager: Box::from(WinApiScreenManager::new())
screen_manager: screen_manager
}
}

View File

@ -21,10 +21,10 @@ pub fn get_terminal_size() -> (u16, u16)
}
/// Get the cursor position based on the current platform.
pub fn get_cursor_position(screen: Rc<Context>) -> (u16, u16)
pub fn get_cursor_position(context: Rc<Context>) -> (u16, u16)
{
#[cfg(unix)]
return pos(&screen);
return pos(context.clone());
#[cfg(windows)]
return pos();

View File

@ -95,9 +95,9 @@ impl Drop for AlternateScreen
// Get the alternate screen command to enable and disable alternate screen based on the current platform
fn get_to_alternate_screen_command(context: Rc<Context>) -> u16
{
// #[cfg(target_os = "windows")]
// let command = functions::get_module::<Box<ICommand>>(win_commands::ToAlternateScreenBufferCommand::new(), shared_commands::ToAlternateScreenBufferCommand::new(), context).unwrap();
#[cfg(target_os = "windows")]
let command = functions::get_module::<Box<ICommand>>(win_commands::ToAlternateScreenBufferCommand::new(), shared_commands::ToAlternateScreenBufferCommand::new(), context).unwrap();
// #[cfg(not(target_os = "windows"))]
win_commands::ToAlternateScreenBufferCommand::new(context)
#[cfg(not(target_os = "windows"))]
shared_commands::ToAlternateScreenBufferCommand::new(context.clone())
}

View File

@ -2,6 +2,8 @@
use Context;
use super::{IStateCommand};
use std::rc::Rc;
pub struct EmptyCommand;
impl IStateCommand for EmptyCommand
@ -18,19 +20,27 @@ impl IStateCommand for EmptyCommand
}
/// This command is used for switching to alternate screen and back to main screen.
pub struct ToAlternateScreenBufferCommand<'a>
pub struct ToAlternateScreenBufferCommand
{
context: &'a Context
context: Rc<Context>
}
impl<'a> ToAlternateScreenBufferCommand<'a>
impl ToAlternateScreenBufferCommand
{
pub fn new(context: & 'a Context) -> Box < ToAlternateScreenBufferCommand > {
Box::from(ToAlternateScreenBufferCommand {context: context})
pub fn new(context: Rc<Context>) -> u16 {
let mut state = context.state_manager.lock().unwrap();
{
let key = state.get_changes_count();
let command = ToAlternateScreenBufferCommand {context: context.clone()};
state.register_change(Box::from(command), key);
key
}
}
}
impl<'context> IStateCommand for ToAlternateScreenBufferCommand<'context>
impl IStateCommand for ToAlternateScreenBufferCommand
{
fn execute(&mut self) -> bool
{

View File

@ -19,14 +19,14 @@ pub struct NoncanonicalModeCommand
impl NoncanonicalModeCommand
{
pub fn new(state: &Mutex<StateManager>) -> u16
pub fn new(state_manager: &Mutex<StateManager>) -> u16
{
let key = 1;
let mut state_manager = state.lock().unwrap();
let mut state = state_manager.lock().unwrap();
{
let command = Box::from(NoncanonicalModeCommand { key: key });
state_manager.register_change(command, key);
let key = state.get_changes_count();
let command = NoncanonicalModeCommand { key: key };
state.register_change(Box::from(command), key);
key
}
}
@ -84,11 +84,12 @@ pub struct EnableRawModeCommand
impl EnableRawModeCommand
{
pub fn new(state_manager: &Mutex<StateManager>) -> u16{
let key = 2;
let mut state = state_manager.lock().unwrap();
{
let key = state.get_changes_count();
let command = EnableRawModeCommand { original_mode: None, command_id: key };
state.register_change(Box::from(command), key);
key
}

View File

@ -158,10 +158,9 @@ impl ToAlternateScreenBufferCommand
{
pub fn new(context: Rc<Context>) -> u16
{
let key = 2;
let mut state = context.state_manager.lock().unwrap();
{
let key = state.get_changes_count();
let command = ToAlternateScreenBufferCommand {context: context.clone()};
state.register_change(Box::from(command), key);

View File

@ -135,7 +135,7 @@ macro_rules! impl_fmt
let mutex = self.context.screen_manager;
{
let mut screen = mutex.lock().unwrap();
screen.write_ansi_str(format!(csi!("{}m"), *attr as i16)).expect("Flush failed");
screen.write_ansi_str(format!(csi!("{}m"), *attr as i16));
}
reset = true;
}
@ -146,7 +146,7 @@ macro_rules! impl_fmt
{
let mut screen = mutex.lock().unwrap();
screen.flush().expect("Flush failed");
screen.flush();
}
if reset