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 c91fef05
authored
Jan 07, 2017
by
Iwasaki Yudai
Committed by
GitHub
Jan 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #121 from guywithnose/lockWindowSize
Add an option to disable client window resizes
2 parents
ddbaa983
8fd09cd9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
app/app.go
app/client_context.go
main.go
app/app.go
View file @
c91fef0
...
...
@@ -70,6 +70,8 @@ type Options struct {
CloseSignal
int
`hcl:"close_signal"`
Preferences
HtermPrefernces
`hcl:"preferences"`
RawPreferences
map
[
string
]
interface
{}
`hcl:"preferences"`
Width
int
`hcl:"width"`
Height
int
`hcl:"height"`
}
var
Version
=
"0.0.13"
...
...
@@ -95,6 +97,8 @@ var DefaultOptions = Options{
Once
:
false
,
CloseSignal
:
1
,
// syscall.SIGHUP
Preferences
:
HtermPrefernces
{},
Width
:
0
,
Height
:
0
,
}
func
New
(
command
[]
string
,
options
*
Options
)
(
*
App
,
error
)
{
...
...
app/client_context.go
View file @
c91fef0
...
...
@@ -197,14 +197,24 @@ func (context *clientContext) processReceive() {
return
}
rows
:=
uint16
(
context
.
app
.
options
.
Height
)
if
rows
==
0
{
rows
=
uint16
(
args
.
Rows
)
}
columns
:=
uint16
(
context
.
app
.
options
.
Width
)
if
columns
==
0
{
columns
=
uint16
(
args
.
Columns
)
}
window
:=
struct
{
row
uint16
col
uint16
x
uint16
y
uint16
}{
uint16
(
args
.
Rows
)
,
uint16
(
args
.
Columns
)
,
rows
,
columns
,
0
,
0
,
}
...
...
main.go
View file @
c91fef0
...
...
@@ -37,6 +37,8 @@ func main() {
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
{
"close-signal"
,
""
,
"Signal sent to the command process when gotty close it (default: SIGHUP)"
},
flag
{
"width"
,
""
,
"Static width of the screen, 0(default) means dynamically resize"
},
flag
{
"height"
,
""
,
"Static height of the screen, 0(default) means dynamically resize"
},
}
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