ruki 1 месяц назад
Родитель
Сommit
a39fe16eb0
2 измененных файлов с 2 добавлено и 272 удалено
  1. 1 136
      docs/posts/xmake-update-v3.0.5.md
  2. 1 136
      docs/zh/posts/xmake-update-v3.0.5.md

+ 1 - 136
docs/posts/xmake-update-v3.0.5.md

@@ -513,122 +513,7 @@ For more details, see: [#6993](https://github.com/xmake-io/xmake/pull/6993)
 
 ### Improve TTY handling and output
 
-We have improved TTY handling and output formatting, providing better terminal compatibility and visual feedback. The `core.base.tty` module now offers comprehensive cursor control and screen management capabilities for creating rich terminal interfaces.
-
-**Key features:**
-
-- **Cursor movement**: Move cursor up, down, left, right, or to specific columns
-- **Line operations**: Clear lines, erase to end of line, move to start of line
-- **Cursor visibility**: Hide/show cursor for smoother animations
-- **Position management**: Save and restore cursor positions
-- **ANSI detection**: Check if terminal supports ANSI control codes
-
-**Basic usage:**
-
-```lua
-import("core.base.tty")
-
--- Check if ANSI is supported
-if tty.has_vtansi() then
-    -- Simple progress bar
-    for i = 0, 100, 5 do
-        tty.cr()              -- Move to start of line
-        tty.erase_line()      -- Clear the line
-        io.write(string.format("Progress: %d%%", i))
-        io.flush()
-        os.sleep(50)
-    end
-    print("")  -- New line after progress
-end
-```
-
-**Update previous lines:**
-
-```lua
-import("core.base.tty")
-
-io.write("Building project...\n")
-io.write("Status: Starting...\n")
-io.flush()
-
-os.sleep(1000)
-
--- Go back and update the status line
-tty.cursor_move_up(1)
-tty.cr()
-tty.erase_line()
-io.write("Status: Compiling files...\n")
-io.flush()
-```
-
-**Multi-line updates:**
-
-```lua
-import("core.base.tty")
-
--- Create a status board
-io.write("Task 1: Waiting...\n")
-io.write("Task 2: Waiting...\n")
-io.write("Task 3: Waiting...\n")
-io.flush()
-
-tty.cursor_hide()
-
--- Update Task 1
-tty.cursor_move_up(3)
-tty.cr()
-tty.erase_line()
-io.write("Task 1: Running...\n")
-io.flush()
-
--- Update Task 2
-tty.cr()
-tty.erase_line()
-io.write("Task 2: Done ✓\n")
-io.flush()
-
-tty.cursor_show()
-```
-
-**Live dashboard example:**
-
-```lua
-import("core.base.tty")
-
--- Create a build dashboard with multiple progress bars
-io.write("⏸ Parse project files       [" .. string.rep("░", 30) .. "]   0%\n")
-io.write("⏸ Compile sources           [" .. string.rep("░", 30) .. "]   0%\n")
-io.write("⏸ Link executable           [" .. string.rep("░", 30) .. "]   0%\n")
-io.flush()
-
-tty.cursor_hide()
-
--- Update each task line independently
-for i = 1, 100 do
-    tty.cursor_move_up(3)
-    
-    -- Update Task 1
-    local progress1 = i / 100
-    local bar1 = string.rep("█", math.floor(progress1 * 30)) .. string.rep("░", 30 - math.floor(progress1 * 30))
-    tty.cr()
-    tty.erase_line()
-    io.write(string.format("▶ Parse project files       [%s] %3d%%\n", bar1, math.floor(progress1 * 100)))
-    
-    -- Update Task 2 (starts later)
-    local progress2 = math.max(0, (i - 20) / 80)
-    local bar2 = string.rep("█", math.floor(progress2 * 30)) .. string.rep("░", 30 - math.floor(progress2 * 30))
-    tty.cr()
-    tty.erase_line()
-    io.write(string.format("▶ Compile sources           [%s] %3d%%\n", bar2, math.floor(progress2 * 100)))
-    
-    io.flush()
-    os.sleep(30)
-end
-
-tty.cursor_show()
-```
-
-**Available functions:**
+We have improved TTY handling and output formatting in the `core.base.tty` module. The following new interfaces have been added:
 
 - `tty.cursor_move_up(n)` / `tty.cursor_move_down(n)` - Move cursor vertically
 - `tty.cursor_move_left(n)` / `tty.cursor_move_right(n)` - Move cursor horizontally
@@ -640,34 +525,14 @@ tty.cursor_show()
 - `tty.erase_line_to_end()` - Erase from cursor to end of line
 - `tty.has_vtansi()` - Check if terminal supports ANSI control codes
 
-This enables creating rich terminal interfaces with progress bars, live dashboards, multi-line status updates, and smooth animations without clearing the entire screen.
-
 For more details, see: [#6970](https://github.com/xmake-io/xmake/pull/6970)
 
-### Refactor Xcode toolchain integration
-
-We have refactored the Xcode toolchain and integrated it into the LLVM toolchain for Apple devices, simplifying toolchain management for macOS and iOS development.
-
-This change makes it easier to switch between different LLVM-based toolchains on Apple platforms.
-
-For more details, see: [#6977](https://github.com/xmake-io/xmake/pull/6977)
-
 ### Add Ghostty terminal detection support
 
 We have added support for detecting the Ghostty terminal, ensuring proper output formatting and color support in this modern terminal emulator.
 
 For more details, see: [#6987](https://github.com/xmake-io/xmake/pull/6987)
 
-### Add Ninja generator support
-
-We have added Ninja generator support to the xmake.sh/configure script, allowing you to generate Ninja build files for faster builds.
-
-```bash
-$ ./xmake.sh --generator=ninja
-```
-
-For more details, see: [#7019](https://github.com/xmake-io/xmake/pull/7019)
-
 ### Improve graph module performance
 
 We have improved the performance of the graph module, which is used for dependency resolution and build graph generation.

+ 1 - 136
docs/zh/posts/xmake-update-v3.0.5.md

@@ -513,122 +513,7 @@ target("test")
 
 ### 改进 TTY 处理和输出
 
-我们改进了 TTY 处理和输出格式化,提供更好的终端兼容性和视觉反馈。`core.base.tty` 模块现在提供了全面的光标控制和屏幕管理功能,用于创建丰富的终端界面。
-
-**主要功能:**
-
-- **光标移动**:向上、向下、向左、向右移动光标,或移动到指定列
-- **行操作**:清除行、清除到行尾、移动到行首
-- **光标可见性**:隐藏/显示光标以实现更流畅的动画
-- **位置管理**:保存和恢复光标位置
-- **ANSI 检测**:检查终端是否支持 ANSI 控制码
-
-**基本用法:**
-
-```lua
-import("core.base.tty")
-
--- 检查是否支持 ANSI
-if tty.has_vtansi() then
-    -- 简单进度条
-    for i = 0, 100, 5 do
-        tty.cr()              -- 移动到行首
-        tty.erase_line()      -- 清除行
-        io.write(string.format("进度: %d%%", i))
-        io.flush()
-        os.sleep(50)
-    end
-    print("")  -- 进度后换行
-end
-```
-
-**更新上一行:**
-
-```lua
-import("core.base.tty")
-
-io.write("正在构建项目...\n")
-io.write("状态: 启动中...\n")
-io.flush()
-
-os.sleep(1000)
-
--- 返回并更新状态行
-tty.cursor_move_up(1)
-tty.cr()
-tty.erase_line()
-io.write("状态: 编译文件中...\n")
-io.flush()
-```
-
-**多行更新:**
-
-```lua
-import("core.base.tty")
-
--- 创建状态面板
-io.write("任务 1: 等待中...\n")
-io.write("任务 2: 等待中...\n")
-io.write("任务 3: 等待中...\n")
-io.flush()
-
-tty.cursor_hide()
-
--- 更新任务 1
-tty.cursor_move_up(3)
-tty.cr()
-tty.erase_line()
-io.write("任务 1: 运行中...\n")
-io.flush()
-
--- 更新任务 2
-tty.cr()
-tty.erase_line()
-io.write("任务 2: 完成 ✓\n")
-io.flush()
-
-tty.cursor_show()
-```
-
-**实时仪表板示例:**
-
-```lua
-import("core.base.tty")
-
--- 创建包含多个进度条的构建仪表板
-io.write("⏸ 解析项目文件       [" .. string.rep("░", 30) .. "]   0%\n")
-io.write("⏸ 编译源文件           [" .. string.rep("░", 30) .. "]   0%\n")
-io.write("⏸ 链接可执行文件       [" .. string.rep("░", 30) .. "]   0%\n")
-io.flush()
-
-tty.cursor_hide()
-
--- 独立更新每个任务行
-for i = 1, 100 do
-    tty.cursor_move_up(3)
-    
-    -- 更新任务 1
-    local progress1 = i / 100
-    local bar1 = string.rep("█", math.floor(progress1 * 30)) .. string.rep("░", 30 - math.floor(progress1 * 30))
-    tty.cr()
-    tty.erase_line()
-    io.write(string.format("▶ 解析项目文件       [%s] %3d%%\n", bar1, math.floor(progress1 * 100)))
-    
-    -- 更新任务 2(稍后开始)
-    local progress2 = math.max(0, (i - 20) / 80)
-    local bar2 = string.rep("█", math.floor(progress2 * 30)) .. string.rep("░", 30 - math.floor(progress2 * 30))
-    tty.cr()
-    tty.erase_line()
-    io.write(string.format("▶ 编译源文件           [%s] %3d%%\n", bar2, math.floor(progress2 * 100)))
-    
-    io.flush()
-    os.sleep(30)
-end
-
-tty.cursor_show()
-```
-
-**可用函数:**
+我们改进了 `core.base.tty` 模块的 TTY 处理和输出格式。新增了以下接口:
 
 - `tty.cursor_move_up(n)` / `tty.cursor_move_down(n)` - 垂直移动光标
 - `tty.cursor_move_left(n)` / `tty.cursor_move_right(n)` - 水平移动光标
@@ -640,34 +525,14 @@ tty.cursor_show()
 - `tty.erase_line_to_end()` - 清除从光标到行尾
 - `tty.has_vtansi()` - 检查终端是否支持 ANSI 控制码
 
-这使得能够创建丰富的终端界面,包括进度条、实时仪表板、多行状态更新和流畅的动画,而无需清除整个屏幕。
-
 更多详情,请参考:[#6970](https://github.com/xmake-io/xmake/pull/6970)
 
-### 重构 Xcode 工具链集成
-
-我们重构了 Xcode 工具链,并将其集成到 Apple 设备的 LLVM 工具链中,简化了 macOS 和 iOS 开发的工具链管理。
-
-这个改动使得在 Apple 平台上切换不同的基于 LLVM 的工具链变得更加容易。
-
-更多详情,请参考:[#6977](https://github.com/xmake-io/xmake/pull/6977)
-
 ### 添加 Ghostty 终端检测支持
 
 我们添加了对 Ghostty 终端的检测支持,确保在这个现代终端模拟器中具有正确的输出格式和颜色支持。
 
 更多详情,请参考:[#6987](https://github.com/xmake-io/xmake/pull/6987)
 
-### 添加 Ninja 生成器支持
-
-我们为 xmake.sh/configure 脚本添加了 Ninja 生成器支持,允许您生成 Ninja 构建文件以获得更快的构建速度。
-
-```bash
-$ ./xmake.sh --generator=ninja
-```
-
-更多详情,请参考:[#7019](https://github.com/xmake-io/xmake/pull/7019)
-
 ### 改进图模块性能
 
 我们改进了图模块的性能,该模块用于依赖解析和构建图生成。