Cross-platform terminal Fabric component for React Native, leveraging SwiftSH/SwiftTerm for iOS, with plans for Termux integration on Android. This initial release introduces a powerful tool for integrating SSH terminal functionality into React Native applications.
Note: This component currently supports the new React Native architecture. Support for the legacy architecture may be added based on community requests.
- iOS Support: Employs SwiftSH/SwiftTerm for comprehensive SSH connectivity and terminal emulation.
- Android Support: Future integration with Termux planned, expanding cross-platform capabilities.
- Flexible Configuration: A wide range of props allows for customizable terminal appearance and SSH connection settings.
- Event Handling: Comprehensive event props for responding to user interactions and session changes effectively.
- Command Execution: Execute commands programmatically within the terminal, enhancing dynamic interaction capabilities.
To add rtn-dev-console to your React Native project, use the following npm command:
npm install rtn-dev-console
Incorporate the SshTerminal
component into your application, configuring it with appropriate props for establishing an SSH connection and handling events:
import React from 'react';
import { SshTerminal } from 'rtn-dev-console';
function App() {
return (
<SshTerminal
host="192.168.1.1"
port={22}
username="your_username"
password="your_password"
onConnected={() => console.log('Connected')}
onClosed={() => console.log('Connection closed')}
style={{ flex: 1 }}
/>
);
}
This snippet demonstrates the basic setup required to initiate an SSH session.
The SshTerminal
component offers a variety of props and event handlers for customizing the SSH session and terminal interface. These include connection details (host
, port
, username
, password
), debug options, and callbacks for significant terminal events (onConnect
, onClosed
, onSizeChanged
, etc.).
- Basic functionality has been verified through example applications. However, as this is an early-stage project, certain terminal methods may exhibit instability.
- Optimized for the new React Native architecture; legacy architecture support may be provided upon request.
Acknowledgments to those whose contributions have made this project possible:
- Miguel de Icaza for SwiftTerm and the SwiftSH fork. These foundational libraries are crucial for SSH communication and terminal emulation on iOS.
- Andrew Madsen for his work on building OpenSSL for ARM/Apple silicon Macs, facilitating secure connections.
- Tommaso Madonia for SwiftSH and invaluable build script examples, enhancing the project's build process and capabilities.
Their efforts have significantly contributed to the development and functionality of rtn-dev-console, and we are grateful for their open-source contributions.
We welcome contributions in all forms: bug reports, feature suggestions, and pull requests. Your involvement is key to the continued improvement and success of rtn-dev-console.