tabby-encoding
v1.0.2
Published
Tabby plugin to switch character encoding in SSH connections - Tabby 终端 SSH 连接字符编码切换插件
Readme
Tabby Encoding Plugin
Plugin Introduction
Tabby Encoding Plugin is a character encoding switching plugin designed for Tabby Terminal. It supports dynamically switching character encoding in SSH connections, solving the problem of encoding inconsistency between servers and terminals.
Main Features
Right-click Menu Encoding Switch
- Adds "Switch Character Encoding" option to the terminal tab right-click menu
- Supports multiple common encodings: UTF-8, GBK, GB2312, Big5, etc.
Encoding Auto-memory
- Automatically saves encoding settings for each connection
- Automatically loads the last used encoding when reconnecting to the same server
Multi-language Support
- Menu supports multi-language display
- Automatically follows Tabby software's language settings
Rich Encoding Support
- Includes multiple common encodings, categorized by language/region
- Encoding list is consistent with mainstream editors for easy lookup
Supported Encodings
- UTF Series: UTF-8, UTF-8 with BOM, UTF-16 LE, UTF-16 BE
- Chinese Encodings: GBK, GB2312, GB18030, Big5, Big5-HKSCS
- Japanese Encodings: Shift JIS, EUC-JP
- Korean Encodings: EUC-KR
- Western Encodings: Windows 1252, ISO 8859-1, ISO 8859-15, etc.
- Cyrillic Encodings: Windows 1251, KOI8-R, CP866, etc.
- Others: Arabic, Baltic, Greek, Hebrew, Turkish, etc.
Installation Method
- Copy the compiled
distfolder contents to the Tabby plugin directory- Windows:
%APPDATA%\tabby\plugins\node_modules\tabby-encoding\
- Windows:
- Restart Tabby Terminal
- Right-click on the SSH connection tab to see the "Switch Character Encoding" menu
Build Method
cd tabby-encoding
npm install
npm run buildUsage Method
- Open an SSH connection
- Right-click on the terminal tab
- Select "Switch Character Encoding"
- Choose the desired encoding from the submenu
- The encoding will take effect immediately and be saved automatically
Disclaimer
⚠️ Important Notice
This plugin was written by AI and is not an official plugin. The author has limited knowledge of TypeScript programming, so code quality and testing may be insufficient.
Risk Warnings
- Insufficient Testing: Due to the author's lack of TypeScript development experience, the plugin may have undiscovered bugs
- Data Security: The plugin intercepts terminal data transmission and performs encoding conversion, theoretically posing a data leakage risk
- System Impact: Modifying terminal encoding settings may affect normal system operation
- Production Environment: It is strongly recommended not to use this plugin in formal production environments
Usage Restrictions
- For learning and personal testing purposes only
- The user assumes full responsibility for any consequences caused by using this plugin
- If you need to use encoding switching functionality in production environments, please use mature official or third-party solutions
Feedback and Support
- If you have feedback issues, the author will try to solve them within their ability
- Due to limited technical level, the resolution time may be longer
- It is recommended to submit issues through the code repository or contact the author directly
Code License
This plugin uses the MIT License, which is a very permissive open-source license:
- You can freely use, modify, and distribute this plugin
- Can be used for personal or commercial projects
- Only need to retain the original copyright notice and license information
- No warranty or liability is provided
Please refer to the LICENSE file in the project root directory for detailed license information.
Technical Description
This plugin is implemented using the following technologies:
- SessionMiddleware: Intercepts session data transmission for encoding conversion
- TerminalDecorator: Listens for terminal tab creation and session changes
- ConfigProvider: Integrates with Tabby's configuration system to save encoding settings
- iconv-lite: Performs encoding and decoding processing
File Structure
src/
├── config.ts # Configuration provider
├── configManager.ts # Configuration manager
├── index.ts # Module entry
├── menu.ts # Right-click menu
├── middleware.ts # Encoding middleware
├── terminal.ts # Terminal decorator
└── translations.ts # Translation filesChangelog
v1.0.2
- Updated dependencies configuration
v1.0.1
- Updated documentation and package configuration
v1.0.0
- Initial version
- Support right-click menu encoding switching
- Support encoding configuration saving and loading
- Support multi-language menu
Tabby Encoding 插件
插件介绍
Tabby Encoding Plugin 是一个为 Tabby Terminal 设计的字符编码切换插件,支持在 SSH 连接中动态切换字符编码,解决服务器与终端之间的编码不一致问题。
主要功能
右键菜单编码切换
- 在终端标签页右键菜单中添加「切换字符集编码」选项
- 支持多种常见编码:UTF-8、GBK、GB2312、Big5 等
编码自动记忆
- 自动保存每个连接的编码设置
- 下次连接同一服务器时自动加载上次使用的编码
多语言支持
- 菜单支持多语言显示
- 自动跟随 Tabby 软件的语言设置
支持丰富编码种类
- 包含多种常见编码,按语言/地区分类显示
- 编码列表与主流编辑器保持一致,方便查找
支持的编码
- UTF 系列:UTF-8、UTF-8 with BOM、UTF-16 LE、UTF-16 BE
- 中文编码:GBK、GB2312、GB18030、Big5、Big5-HKSCS
- 日文编码:Shift JIS、EUC-JP
- 韩文编码:EUC-KR
- 西文编码:Windows 1252、ISO 8859-1、ISO 8859-15 等
- 西里尔编码:Windows 1251、KOI8-R、CP866 等
- 其他:阿拉伯语、波罗的海语、希腊语、希伯来语、土耳其语等
安装方法
- 将编译后的
dist文件夹内容复制到 Tabby 插件目录- Windows:
%APPDATA%\tabby\plugins\node_modules\tabby-encoding\
- Windows:
- 重启 Tabby Terminal
- 在 SSH 连接标签页上右键即可看到「切换字符集编码」菜单
编译方法
cd tabby-encoding
npm install
npm run build使用方法
- 打开一个 SSH 连接
- 右键点击终端标签页
- 选择「切换字符集编码」
- 从子菜单中选择需要的编码
- 编码会立即生效,并自动保存
免责声明
⚠️ 重要提示
本插件由 AI 编写,非官方插件。作者本人对 TypeScript 编程了解有限,代码质量和测试可能存在不足。
风险提示
- 测试不足:由于作者缺乏 TypeScript 开发经验,插件可能存在未发现的 bug
- 数据安全:插件会拦截终端数据传输并进行编码转换,理论上存在数据泄露风险
- 系统影响:修改终端编码设置可能影响系统正常运行
- 正式环境:强烈建议不要在正式生产环境中使用本插件
使用限制
- 仅供学习和个人测试使用
- 使用本插件造成的一切后果由使用者自行承担
- 如需在生产环境中使用编码切换功能,请使用成熟的官方或第三方解决方案
反馈与支持
- 如有反馈问题,作者会在能力范围内尽量解决
- 由于技术水平有限,解决时间可能较长
- 建议通过代码仓库提交 issue 或直接联系作者
代码协议
本插件采用 MIT 许可证,这是一个非常宽松的开源协议:
- 您可以自由使用、修改和分发本插件
- 可以用于个人或商业项目
- 只需保留原始版权声明和许可证信息
- 不提供任何担保或责任
详细许可证信息请参考项目根目录的 LICENSE 文件。
技术说明
本插件使用以下技术实现:
- SessionMiddleware:拦截会话数据传输,进行编码转换
- TerminalDecorator:监听终端标签页创建和会话变化
- ConfigProvider:集成 Tabby 配置系统,保存编码设置
- iconv-lite:进行编码解码处理
文件结构
src/
├── config.ts # 配置提供者
├── configManager.ts # 配置管理器
├── index.ts # 模块入口
├── menu.ts # 右键菜单
├── middleware.ts # 编码中间件
├── terminal.ts # 终端装饰器
└── translations.ts # 翻译文件更新日志
v1.0.2
- 修改依赖配置
v1.0.1
- 更新描述信息
v1.0.0
- 初始版本
- 支持右键菜单切换编码
- 支持编码配置保存和加载
- 支持多语言菜单
