|
@ -1,10 +1,5 @@ |
|
|
'use strict'; |
|
|
'use strict'; |
|
|
import { env, TextEditor, Uri, window } from 'vscode'; |
|
|
|
|
|
import { Container } from '../container'; |
|
|
|
|
|
import { GitUri } from '../git/gitUri'; |
|
|
|
|
|
import { Logger } from '../logger'; |
|
|
|
|
|
import { Messages } from '../messages'; |
|
|
|
|
|
import { Iterables } from '../system'; |
|
|
|
|
|
|
|
|
import { env, TextEditor, Uri } from 'vscode'; |
|
|
import { |
|
|
import { |
|
|
ActiveEditorCommand, |
|
|
ActiveEditorCommand, |
|
|
command, |
|
|
command, |
|
@ -15,6 +10,11 @@ import { |
|
|
isCommandContextViewNodeHasCommit, |
|
|
isCommandContextViewNodeHasCommit, |
|
|
isCommandContextViewNodeHasTag, |
|
|
isCommandContextViewNodeHasTag, |
|
|
} from './common'; |
|
|
} from './common'; |
|
|
|
|
|
import { Container } from '../container'; |
|
|
|
|
|
import { GitUri } from '../git/gitUri'; |
|
|
|
|
|
import { Logger } from '../logger'; |
|
|
|
|
|
import { Messages } from '../messages'; |
|
|
|
|
|
import { Iterables } from '../system'; |
|
|
|
|
|
|
|
|
export interface CopyMessageToClipboardCommandArgs { |
|
|
export interface CopyMessageToClipboardCommandArgs { |
|
|
message?: string; |
|
|
message?: string; |
|
@ -97,15 +97,6 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand { |
|
|
|
|
|
|
|
|
void (await env.clipboard.writeText(args.message)); |
|
|
void (await env.clipboard.writeText(args.message)); |
|
|
} catch (ex) { |
|
|
} catch (ex) { |
|
|
const msg: string = ex?.message ?? ''; |
|
|
|
|
|
if (msg.includes("Couldn't find the required `xsel` binary")) { |
|
|
|
|
|
void window.showErrorMessage( |
|
|
|
|
|
'Unable to copy message, xsel is not installed. Please install it via your package manager, e.g. `sudo apt install xsel`', |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Logger.error(ex, 'CopyMessageToClipboardCommand'); |
|
|
Logger.error(ex, 'CopyMessageToClipboardCommand'); |
|
|
void Messages.showGenericErrorMessage('Unable to copy message'); |
|
|
void Messages.showGenericErrorMessage('Unable to copy message'); |
|
|
} |
|
|
} |
|
|