mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-23 14:59:41 +08:00
copy notification
This commit is contained in:
parent
c90a5678cf
commit
b5f96a59f8
@ -2,6 +2,7 @@ import 'zone.js'
|
||||
import 'core-js/es7/reflect'
|
||||
import 'core-js/core/delay'
|
||||
import 'rxjs'
|
||||
import './toastr.scss'
|
||||
|
||||
// Always land on the start view
|
||||
location.hash = ''
|
||||
|
16
app/src/toastr.scss
Normal file
16
app/src/toastr.scss
Normal file
@ -0,0 +1,16 @@
|
||||
#toast-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.toast {
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.25);
|
||||
padding: 10px;
|
||||
background-image: none;
|
||||
width: auto;
|
||||
|
||||
&.toast-info {
|
||||
background-color: #555;
|
||||
}
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -55,6 +55,7 @@ module.exports = {
|
||||
/^rxjs/,
|
||||
/^@angular/,
|
||||
/^@ng-bootstrap/,
|
||||
'ngx-toastr',
|
||||
/^terminus-/,
|
||||
],
|
||||
plugins: [
|
||||
|
Loading…
Reference in New Issue
Block a user