copy notification

This commit is contained in:
Eugene Pankov
2018-03-30 23:24:34 +02:00
parent c90a5678cf
commit b5f96a59f8
5 changed files with 28 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
import { BehaviorSubject, Subject, Subscription } from 'rxjs'
import 'rxjs/add/operator/bufferTime'
import { ToastrService } from 'ngx-toastr'
import { Component, NgZone, Inject, Optional, ViewChild, HostBinding, Input } from '@angular/core'
import { AppService, ConfigService, BaseTabComponent, ElectronService, ThemesService, HostAppService, HotkeysService, Platform } from 'terminus-core'
@@ -54,6 +54,7 @@ export class TerminalTabComponent extends BaseTabComponent {
private electron: ElectronService,
private terminalService: TerminalService,
public config: ConfigService,
private toastr: ToastrService,
@Optional() @Inject(TerminalDecorator) private decorators: TerminalDecorator[],
) {
super()
@@ -219,6 +220,12 @@ export class TerminalTabComponent extends BaseTabComponent {
this.alternateScreenActive$.next(state)
}
const _copySelectionToClipboard = hterm.copySelectionToClipboard.bind(hterm)
hterm.copySelectionToClipboard = () => {
_copySelectionToClipboard()
this.toastr.info('Copied')
}
hterm.primaryScreen_.syncSelectionCaret = () => null
hterm.alternateScreen_.syncSelectionCaret = () => null
hterm.primaryScreen_.terminal = hterm

View File

@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { FormsModule } from '@angular/forms'
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
import { ToastrModule } from 'ngx-toastr'
import { ToolbarButtonProvider, TabRecoveryProvider, ConfigProvider, HotkeysService, HotkeyProvider, AppService, ConfigService } from 'terminus-core'
import { SettingsTabProvider } from 'terminus-settings'
@@ -41,6 +42,7 @@ import { hterm } from './hterm'
BrowserModule,
FormsModule,
NgbModule,
ToastrModule,
],
providers: [
SessionsService,

View File

@@ -55,6 +55,7 @@ module.exports = {
/^rxjs/,
/^@angular/,
/^@ng-bootstrap/,
'ngx-toastr',
/^terminus-/,
],
plugins: [