OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // +build linux,!appengine darwin | 5 // +build linux,!appengine darwin freebsd |
6 | 6 |
7 // Package terminal provides support functions for dealing with terminals, as | 7 // Package terminal provides support functions for dealing with terminals, as |
8 // commonly found on UNIX systems. | 8 // commonly found on UNIX systems. |
9 // | 9 // |
10 // Putting a terminal into raw mode is the most common requirement: | 10 // Putting a terminal into raw mode is the most common requirement: |
11 // | 11 // |
12 // oldState, err := terminal.MakeRaw(0) | 12 // oldState, err := terminal.MakeRaw(0) |
13 // if err != nil { | 13 // if err != nil { |
14 // panic(err) | 14 // panic(err) |
15 // } | 15 // } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 n-- | 119 n-- |
120 } | 120 } |
121 ret = append(ret, buf[:n]...) | 121 ret = append(ret, buf[:n]...) |
122 if n < len(buf) { | 122 if n < len(buf) { |
123 break | 123 break |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 return ret, nil | 127 return ret, nil |
128 } | 128 } |
OLD | NEW |