mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2026-03-07 22:33:39 +00:00
```
chore(scripts): 调整终端窗口大小配置 启动时将终端窗口大小从 1024x768 调整为 120x40, 以适配更常见的终端显示需求。 ```
This commit is contained in:
@@ -19,10 +19,10 @@ YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# 启动时尝试调整终端窗口大小为 1024x768(列x行);不支持/失败时静默忽略,避免影响脚本主流程
|
||||
# 启动时尝试调整终端窗口大小为 120x40(列x行);不支持/失败时静默忽略,避免影响脚本主流程
|
||||
try_resize_terminal_window() {
|
||||
local target_cols=1024
|
||||
local target_rows=768
|
||||
local target_cols=120
|
||||
local target_rows=40
|
||||
|
||||
# 仅在交互终端中尝试,避免输出被重定向时出现乱码
|
||||
if [ ! -t 1 ]; then
|
||||
|
||||
@@ -37,10 +37,10 @@ YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# 启动时尝试调整终端窗口大小为 1024x768(列x行);不支持/失败时静默忽略,避免影响脚本主流程
|
||||
# 启动时尝试调整终端窗口大小为 120x40(列x行);不支持/失败时静默忽略,避免影响脚本主流程
|
||||
try_resize_terminal_window() {
|
||||
local target_cols=1024
|
||||
local target_rows=768
|
||||
local target_cols=120
|
||||
local target_rows=40
|
||||
|
||||
# 仅在交互终端中尝试,避免输出被重定向时出现乱码
|
||||
if [ ! -t 1 ]; then
|
||||
|
||||
@@ -10,11 +10,11 @@ $YELLOW = "$ESC[33m"
|
||||
$BLUE = "$ESC[34m"
|
||||
$NC = "$ESC[0m"
|
||||
|
||||
# 启动时尝试调整终端窗口大小为 1024x768(列x行);不支持/失败时静默忽略,避免影响脚本主流程
|
||||
# 启动时尝试调整终端窗口大小为 120x40(列x行);不支持/失败时静默忽略,避免影响脚本主流程
|
||||
function Try-ResizeTerminalWindow {
|
||||
param(
|
||||
[int]$Columns = 1024,
|
||||
[int]$Rows = 768
|
||||
[int]$Columns = 120,
|
||||
[int]$Rows = 40
|
||||
)
|
||||
|
||||
# 方式1:通过 PowerShell Host RawUI 调整(传统控制台、ConEmu 等可能支持)
|
||||
@@ -58,7 +58,7 @@ function Try-ResizeTerminalWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Try-ResizeTerminalWindow -Columns 1024 -Rows 768
|
||||
Try-ResizeTerminalWindow -Columns 120 -Rows 40
|
||||
|
||||
# 路径解析:优先使用 .NET 获取系统目录,避免环境变量缺失导致路径异常
|
||||
function Get-FolderPathSafe {
|
||||
|
||||
Reference in New Issue
Block a user