Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
haoqu.ma
/
gotty
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 888fe870
authored
Oct 13, 2015
by
Iwasaki Yudai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add configuration to modify signal sent to child process when close it
1 parent
95ad63e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletions
app/app.go
app/client_context.go
main.go
app/app.go
View file @
888fe87
...
@@ -64,6 +64,7 @@ type Options struct {
...
@@ -64,6 +64,7 @@ type Options struct {
ReconnectTime
int
`hcl:"reconnect_time"`
ReconnectTime
int
`hcl:"reconnect_time"`
Once
bool
`hcl:"once"`
Once
bool
`hcl:"once"`
PermitArguments
bool
`hcl:"permit_arguments"`
PermitArguments
bool
`hcl:"permit_arguments"`
CloseSignal
int
`hcl:"close_signal"`
Preferences
HtermPrefernces
`hcl:"preferences"`
Preferences
HtermPrefernces
`hcl:"preferences"`
RawPreferences
map
[
string
]
interface
{}
`hcl:"preferences"`
RawPreferences
map
[
string
]
interface
{}
`hcl:"preferences"`
}
}
...
@@ -88,6 +89,7 @@ var DefaultOptions = Options{
...
@@ -88,6 +89,7 @@ var DefaultOptions = Options{
EnableReconnect
:
false
,
EnableReconnect
:
false
,
ReconnectTime
:
10
,
ReconnectTime
:
10
,
Once
:
false
,
Once
:
false
,
CloseSignal
:
1
,
// syscall.SIGHUP
Preferences
:
HtermPrefernces
{},
Preferences
:
HtermPrefernces
{},
}
}
...
...
app/client_context.go
View file @
888fe87
...
@@ -75,7 +75,7 @@ func (context *clientContext) goHandleClient() {
...
@@ -75,7 +75,7 @@ func (context *clientContext) goHandleClient() {
// Even if the PTY has been closed,
// Even if the PTY has been closed,
// Read(0 in processSend() keeps blocking and the process doen't exit
// Read(0 in processSend() keeps blocking and the process doen't exit
context
.
command
.
Process
.
Signal
(
syscall
.
S
IGHUP
)
context
.
command
.
Process
.
Signal
(
syscall
.
S
ignal
(
context
.
app
.
options
.
CloseSignal
)
)
context
.
command
.
Wait
()
context
.
command
.
Wait
()
context
.
connection
.
Close
()
context
.
connection
.
Close
()
...
...
main.go
View file @
888fe87
...
@@ -35,6 +35,7 @@ func main() {
...
@@ -35,6 +35,7 @@ func main() {
flag
{
"reconnect-time"
,
""
,
"Time to reconnect"
},
flag
{
"reconnect-time"
,
""
,
"Time to reconnect"
},
flag
{
"once"
,
""
,
"Accept only one client and exit on disconnection"
},
flag
{
"once"
,
""
,
"Accept only one client and exit on disconnection"
},
flag
{
"permit-arguments"
,
""
,
"Permit clients to send command line arguments in URL (e.g. http://example.com:8080/?arg=AAA&arg=BBB)"
},
flag
{
"permit-arguments"
,
""
,
"Permit clients to send command line arguments in URL (e.g. http://example.com:8080/?arg=AAA&arg=BBB)"
},
flag
{
"close-signal"
,
""
,
"Signal sent to the command process when gotty close it (default: SIGHUP)"
},
}
}
mappingHint
:=
map
[
string
]
string
{
mappingHint
:=
map
[
string
]
string
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment