Skip to content

Commit

Permalink
Merge pull request #94 from eqxmedianl/x11
Browse files Browse the repository at this point in the history
Added setting that allows to change the remote X11 display number
  • Loading branch information
DamianSuess authored Dec 2, 2024
2 parents fb197fa + ea79ee8 commit e190ef3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/VsLinuxDebugger/Commands.Impl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private UserOptions ToUserOptions()
LocalSwitchLinuxDbgOutput = VsixPackage.VsixOptions.SwitchLinuxDbgOutput,

RemoteDebugDisplayGui = VsixPackage.VsixOptions.RemoteDebugDisplayGui,
RemoteDebugDisplayNumber = VsixPackage.VsixOptions.RemoteDebugDisplayNumber,
RemoteDeployBasePath = VsixPackage.VsixOptions.RemoteDeployBasePath,
RemoteDotNetPath = VsixPackage.VsixOptions.RemoteDotNetPath,
RemoteVsDbgBasePath = VsixPackage.VsixOptions.RemoteVsDbgRootPath,
Expand Down
6 changes: 5 additions & 1 deletion src/VsLinuxDebugger/Core/LaunchBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ public string GenerateLaunchJson(bool vsdbgLogging = false)
string displayAdapter = "";

if(_opts.RemoteDebugDisplayGui)
displayAdapter = "DISPLAY=:0";
{
displayAdapter = !string.IsNullOrWhiteSpace(_opts.RemoteDebugDisplayNumber) ?
$"DISPLAY={_opts.RemoteDebugDisplayNumber}" :
"DISPLAY=:0";
}

if (_opts.UseSSHExeEnabled)
{
Expand Down
1 change: 1 addition & 0 deletions src/VsLinuxDebugger/Core/UserOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class UserOptions
public bool LocalSwitchLinuxDbgOutput { get; set; }

public bool RemoteDebugDisplayGui { get; set; }
public string RemoteDebugDisplayNumber { get; set; }
public string RemoteDeployBasePath { get; set; }
/// <summary>Full path to `dotnet` executable.</summary>
public string RemoteDotNetPath { get; set; }
Expand Down
24 changes: 15 additions & 9 deletions src/VsLinuxDebugger/OptionsPages/OptionsPage.Ssh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ namespace Xeno.VsLinuxDebug.OptionsPages
{
public partial class OptionsPage : DialogPage
{
private const string Credientials = "Remote Credientials";
private const string Credentials = "Remote Credentials";
private const string XDisplay = "Remote X11 Display";

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("Host IP Address")]
[Description("Host IP Address. On VMs using 'NAT', set IP to '127.0.0.1' and forward Port 22. PCs and VMs 'Bridged', have their own IP.")]
public string HostIp { get; set; } = "127.0.0.1";
Expand All @@ -19,39 +20,39 @@ public partial class OptionsPage : DialogPage
////[Description("Remote Host Port Number (SSH Default is 22)")]
public int HostPort { get; set; } = 22;

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("User Group Name (optional)")]
[Description("Remote Machine Group Name. For basic setups (i.e. RaspberryPI) it's the same as UserName.")]
public string UserGroupName { get; set; } = "";

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("User Name")]
[Description("SSH User name on remote machine.")]
public string UserName { get; set; } = "pi";

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("User Password")]
[Description("SSH Password on remote machine.")]
public string UserPass { get; set; } = "raspberry";

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("SSH Key File Enabled")]
[Description("Use SSH Key for connecting to remote machine.")]
public bool UserPrivateKeyEnabled { get; set; } = false;

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("SSH Private Key File (optional)")]
[Description("Private key file.")]
public string UserPrivateKeyPath { get; set; } = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".ssh\\id_rsa");

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("SSH Private Key Password (optional)")]
[Description("Private key password (only if it was set).")]
public string UserPrivateKeyPassword { get; set; } = "";

[Category(Credientials)]
[Category(Credentials)]
[DisplayName("Use SSH.exe with integrated user/[..]/.ssh/id_rsa instead of PLINK")]
[Description("Use SSH.exe with integrated user/[..]/.ssh/id_rsa instead of PLINK")]
public bool UseSSHExeEnabled { get; set; } = true;
Expand All @@ -68,5 +69,10 @@ public partial class OptionsPage : DialogPage
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".ssh\\id_rsa");
*/

[Category(XDisplay)]
[DisplayName("Remote X11 Display Number (optional)")]
[Description("Remote X11 Display number (only if it was set). Defaults to ':0'.")]
public string RemoteDebugDisplayNumber { get; set; } = ":0";
}
}

0 comments on commit e190ef3

Please sign in to comment.