Check for supported terminal emulators before activating SSH button.
This commit is contained in:
parent
0c2c15481a
commit
4b515ef6c8
|
|
@ -29,6 +29,24 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
bool _spicy = false;
|
bool _spicy = false;
|
||||||
final List<String> _sshVms = [];
|
final List<String> _sshVms = [];
|
||||||
String? _terminalEmulator;
|
String? _terminalEmulator;
|
||||||
|
final List<String> _supportedTerminalEmulators = [
|
||||||
|
'cool-retro-term',
|
||||||
|
'gnome-terminal',
|
||||||
|
'guake',
|
||||||
|
'mate-terminal',
|
||||||
|
'konsole',
|
||||||
|
'lxterm',
|
||||||
|
'lxterminal',
|
||||||
|
'pterm',
|
||||||
|
'sakura',
|
||||||
|
'terminator',
|
||||||
|
'tilix',
|
||||||
|
'uxterm',
|
||||||
|
'uxrvt',
|
||||||
|
'xfce4-terminal',
|
||||||
|
'xrvt',
|
||||||
|
'xterm'
|
||||||
|
];
|
||||||
Timer? refreshTimer;
|
Timer? refreshTimer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -61,10 +79,12 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
ProcessResult result = await Process.run('which', ['x-terminal-emulator']);
|
ProcessResult result = await Process.run('which', ['x-terminal-emulator']);
|
||||||
if (result.exitCode == 0) {
|
if (result.exitCode == 0) {
|
||||||
String terminalEmulator = await File(result.stdout.toString().trim()).resolveSymbolicLinks();
|
String terminalEmulator = await File(result.stdout.toString().trim()).resolveSymbolicLinks();
|
||||||
stdout.writeln(terminalEmulator);
|
terminalEmulator = path.basenameWithoutExtension(terminalEmulator);
|
||||||
setState(() {
|
if (_supportedTerminalEmulators.contains(terminalEmulator)) {
|
||||||
_terminalEmulator = path.basename(terminalEmulator);
|
setState(() {
|
||||||
});
|
_terminalEmulator = path.basename(terminalEmulator);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue