Changeset 2005
- Timestamp:
- Oct 9, 2012, 9:36:01 PM (10 years ago)
- Location:
- trunk/tools/neercs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/term/pty.cpp
r1896 r2005 45 45 : m_fd(-1), 46 46 m_pid(-1), 47 m_eof(false), 47 48 m_unread_data(0), 48 49 m_unread_len(0) … … 105 106 } 106 107 108 bool Pty::IsEof() const 109 { 110 return m_eof; 111 } 112 107 113 size_t Pty::ReadData(char *data, size_t maxlen) 108 114 { … … 142 148 { 143 149 Log::Error("cannot read from PTY\n"); 150 m_eof = true; 144 151 return 0; 145 152 } 146 147 if (ret) 153 else if (ret) 148 154 { 149 155 if (FD_ISSET((int)m_fd, &fdset)) 150 156 { 151 157 ssize_t nr = read((int)m_fd, data, maxlen); 158 159 /* Data available but zero-length read: EOF */ 160 if (nr <= 0) 161 m_eof = true; 162 152 163 if (nr >= 0) 153 164 return nr; -
trunk/tools/neercs/term/pty.h
r1896 r2005 13 13 14 14 void Run(char const *command, ivec2 size); 15 bool IsEof() const; 15 16 16 17 size_t ReadData(char *data, size_t maxlen); … … 23 24 int64_t m_fd; 24 25 int64_t m_pid; 26 bool m_eof; 25 27 char const *m_argv[2]; 26 28 char *m_unread_data; -
trunk/tools/neercs/term/term.cpp
r1978 r2005 114 114 } 115 115 116 /* This is the real terminal code */117 /* XXX: for now we draw fancy shit */118 116 m_time += seconds; 117 118 if (m_pty->IsEof()) 119 { 120 /* FIXME: we could do more interesting things here… */ 121 Ticker::Shutdown(); 122 } 119 123 120 124 m_pty->SetWindowSize(ivec2(caca_get_canvas_width(m_caca), 121 125 caca_get_canvas_height(m_caca))); 122 126 127 /* This is the real terminal code */ 123 128 size_t total = 0; 124 129 for (;;) -
trunk/tools/neercs/video/render.cpp
r2003 r2005 727 727 { 728 728 /* keyboard manager */ 729 if (Input::WasReleased(Key::Escape))730 {731 Ticker::Shutdown();732 }733 729 if (Input::WasPressed(Key::F1)) 734 730 {
Note: See TracChangeset
for help on using the changeset viewer.