import { Component } from '@angular/core' import { ConfigService } from 'tabby-core' @Component({ template: `

Backslash Newline Settings

Enter the text to send when hotkey is pressed. Use \\\\n for newline, \\\\t for tab, \\\\\\\\ for backslash. ✓ Settings saved automatically
{{getPreviewText()}}
How to use:
  1. Configure your custom text above
  2. Go to Settings → Hotkeys
  3. Find "Send configured custom text"
  4. Set your preferred hotkey (default: Shift+Enter)
  5. Press the hotkey in any terminal to send your custom text
`, }) export class BackslashNewlineSettingsTabComponent { customText: string = ' \\\n' saveStatus: boolean = false private readonly defaultText = ' \\\n' constructor(private config: ConfigService) { this.customText = this.config.store?.backslashNewline?.customText || this.defaultText } onTextChange() { // 直接設定配置值 if (!this.config.store.backslashNewline) { (this.config.store as any).backslashNewline = {} } (this.config.store as any).backslashNewline.customText = this.customText this.config.save() // Show save status for 2 seconds this.saveStatus = true setTimeout(() => { this.saveStatus = false }, 2000) } resetToDefault() { this.customText = this.defaultText this.onTextChange() } getPreviewText(): string { return this.customText .replace(/\\\\/g, '\\') .replace(/\\n/g, '⏎') .replace(/\\t/g, '→') .replace(/ /g, '·') } }